Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Python中导入Matlab引擎:OSError版本'GLIBCXX_3.4.22';找不到_Python_Matlab - Fatal编程技术网

在Python中导入Matlab引擎:OSError版本'GLIBCXX_3.4.22';找不到

在Python中导入Matlab引擎:OSError版本'GLIBCXX_3.4.22';找不到,python,matlab,Python,Matlab,当我按照MathWorks页面()上的说明运行命令时 导入matlab.engine 出现以下错误: enter code here runfile('/media/mattes/data1/dataDMattes/Code/Python/PythonProgram /main.py', wdir='/media/mattes/data1/dataDMattes/Code/Python/PythonProgram') Reloaded modules: shapely.geometry, s

当我按照MathWorks页面()上的说明运行命令时
导入matlab.engine
出现以下错误:

enter code here

runfile('/media/mattes/data1/dataDMattes/Code/Python/PythonProgram  /main.py', wdir='/media/mattes/data1/dataDMattes/Code/Python/PythonProgram')
Reloaded modules: shapely.geometry, shapely.algorithms.cga, fiona.compat, shapely.geometry.polygon, pyproj._proj, shapely.geometry.linestring, _proj, fiona._err, shapely.geometry.base, shapely.ftools, shapely.linref, shapely.ops, shapely.predicates, shapely.wkt, _internal, centerline.io, shapely.geometry.geo, shapely.topology, fiona.ogrext, mlarray, _internal.mlarray_utils, shapely.coords, shapely.affinity, shapely.geometry.collection, matlab, shapely.geometry.proxy, centerline.utils, shapely.ctypes_declarations, mlexceptions, fiona.rfc3339, fiona._geometry, shapely, _internal.mlarray_sequence, fiona._drivers, fiona.drvsupport, fiona, shapely.geometry.multipoint, pyproj, shapefile, shapely.speedups, centerline.main, shapely.algorithms, shapely.speedups._speedups, shapely.geometry.multipolygon, pyproj.datadir, shapely.geometry.point, fiona.errors, shapely.impl, shapely.geometry.multilinestring, fiona.collection, shapely.geos, shapely.errors, centerline
Traceback (most recent call last):

File "<ipython-input-2-820f256278b1>", line 1, in <module>
runfile('/media/mattes/data1/dataDMattes/Code/Python/PythonProgram/main.py', wdir='/media/mattes/data1/dataDMattes/Code/Python/PythonProgram')

File "/usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 699, in runfile
execfile(filename, namespace)

File "/usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 88, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)

File "/media/mattes/data1/dataDMattes/Code/Python/PythonProgram/main.py", line 42, in <module>
import matlab.engine

File "/home/mattes/.local/lib/python3.5/site-packages/matlab/engine/__init__.py", line 62, in <module>
'MathWorks Technical Support for assistance: %s' % e)

OSError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/MATLAB/R2018a/extern/engines/python/dist/matlab/engine/glnxa64/../../../../../../../bin/glnxa64/libmwengine_api.so)
我使用Python 3.5.2,并在Ubuntu 16.04中安装了MatlabR2018A

有人有主意吗

非常感谢你的帮助

未找到GLIBCXX_3.4.22'

您可以在例如$HOME中解包
libstdc++.so.6->libstdc++.so.6.0.22
,并在运行命令时将其包括在内:示例→

export LD_LIBRARY_PATH=/home/[name]/libstdc++6_6.3.0_amd64:$LD_LIBRARY_PATH && import matlab.engine
什么是。。。[命令]

[command]是指在$HOME中与
libstdc++.so.6
一起使用的“任意命令”

关于文件夹libstdc++6_6.3.0_amd64/:您可以重命名为例如
lib64
以使用较短的文件名:/home/[name]/lib64/→

export LD_LIBRARY_PATH=/home/[name]/lib64:$LD_LIBRARY_PATH && import matlab.engine

»»GLIBCXX_3.4.22'未找到««:您可以将
libstdc++.so.6->libstdc++.so.6.0.22
解包到例如$HOME中,并在运行命令时将其包括在内:
export LD_LIBRARY_PATH=/HOME/[name]/libstdc++6.3.0\amd64:$LD_LIBRARY_PATH&[command]
。。。链接到“libstdc++6_6.3.0_amd64.tar.gz”非常感谢您的评论,我将在周一回来工作时测试它。我是Python新手,您为
LD_库
提到的
[命令]
是什么?非常感谢您的回答,我会尽快尝试!
export LD_LIBRARY_PATH=/home/[name]/lib64:$LD_LIBRARY_PATH && import matlab.engine