Running python code from Matlab program on Ubuntu

11 ビュー (過去 30 日間)
Gilad Book
Gilad Book 2018 年 4 月 26 日
I try to use system(my_trigger_str) function in matlab in order to run my python program on Ubuntu (16.04).
While when I run my_trigger_str from the terminal it runs well, when I run it using system() in matlab it does not succeed import any package I use in my python code. For example, I import matplotlib in line 3 in my python program, and I receive this error. It happens for any package I try to import. From the terminal in runs well.
Any idea?
Traceback (most recent call last):
File "/home/kent/Desktop/SegUtilities/eval_model_PR.py", line 3, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 36, in <module>
from matplotlib.figure import Figure, figaspect
File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 35, in <module>
from matplotlib import _image
ImportError: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version
`GLIBCXX_3.4.21' not found (required by /usr/lib/python3/dist-packages/matplotlib/_image.cpython-35m-x86_64-linux-gnu.so)
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ImportError: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version
`GLIBCXX_3.4.21' not found (required by /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-x86_64-linux-gnu.so)
Original exception was:
Traceback (most recent call last):
File "/home/kent/Desktop/SegUtilities/eval_model_PR.py", line 3, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 36, in <module>
from matplotlib.figure import Figure, figaspect
File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 35, in <module>
from matplotlib import _image
ImportError: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version
`GLIBCXX_3.4.21' not found (required by /usr/lib/python3/dist-packages/matplotlib/_image.cpython-35m-x86_64-linux-gnu.so)
22 inputParts = regexp(inputArray, ';', 'split');

回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by