Dependencies Matlab Python编译器SDK失败,返回“0”;未定义符号:XML_SetHashSalt";

Dependencies Matlab Python编译器SDK失败,返回“0”;未定义符号:XML_SetHashSalt";,dependencies,python-3.6,matlab-compiler,Dependencies,Python 3.6,Matlab Compiler,我正在使用MatlabR2018A和Python3.6(安装了3.5和2.7,但未使用)开发Ubuntu 16.0464位 我有一个Matlab代码,它正试图通过使用并遵循上的说明从Python调用。我按照链接到word的所有说明进行操作,创建Matlab Python包装器(web)安装程序并安装它们,按照安装程序的建议更改LD_LIBRARY_路径。我已经尝试了他们展示的MagicSquarePkg示例,它在这种方法中运行良好。但是MagicSquarePkg没有使用任何Matlab工具箱函

我正在使用MatlabR2018A和Python3.6(安装了3.5和2.7,但未使用)开发Ubuntu 16.0464位

我有一个Matlab代码,它正试图通过使用并遵循上的说明从Python调用。我按照链接到word的所有说明进行操作,创建Matlab Python包装器(web)安装程序并安装它们,按照安装程序的建议更改LD_LIBRARY_路径。我已经尝试了他们展示的MagicSquarePkg示例,它在这种方法中运行良好。但是MagicSquarePkg没有使用任何Matlab工具箱函数;我的代码是这样的。使用代码执行此过程后,出现以下错误:

<username>:~/MatlabWorkspace/rs_cuboid_measure_script_python_attempt2/for_testing$ python3.6

Python 3.6.5 (default, Mar 29 2018, 03:28:50) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> import rs_cuboid_measure_script_python *my Matlab module*
Exception caught during initialization of Python interface. Details: 
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0: undefined symbol: 
XML_SetHashSalt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<$HOME>/MatlabWorkspace/rs_cuboid_measure_script_python_attempt2/for_testing/rs_cuboid_measure_script_python/__init__.py", line 283, in <module>
_pir.import_cppext()
File "<$HOME>/MatlabWorkspace/rs_cuboid_measure_script_python_attempt2/for_testing/rs_cuboid_measure_script_python/__init__.py", line 276, in import_cppext
self.cppext_handle = importlib.import_module("matlabruntimeforpython" + self.interpreter_version)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0: undefined symbol: XML_SetHashSalt
在导入模块之前,我得到一个segfault:

>>> import pyexpat
>>> import rs_cuboid_measure_script_python
Segmentation fault (core dumped)
(二)

基于此链接,依赖项包括:

<username>:/usr/lib/x86_64-linux-gnu$ ldd libpython3.6m.so.1.0

linux-vdso.so.1 =>  (0x00007ffed491a000)
libexpat.so.1 => /usr/local/MATLAB/MATLAB_Runtime/v94/bin/glnxa64/libexpat.so.1 (0x00007f90cb2b4000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f90cb09a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f90cae7d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f90cac79000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f90caa76000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f90ca76d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f90ca3a3000)
/lib64/ld-linux-x86-64.so.2 (0x00007f90cbbd1000)
根据上给出的说明 (注意:正确的路径并不完全是链接上的路径,而是上面控制台输出上的路径,正如我的Mathworks支持所确认的那样)

(六)

我们非常感谢您对解决此问题的任何帮助

编辑:凭直觉,我用Python2.7而不是3.6运行了我的Matlab模块,它似乎在使用2.7,但不是3.6

:~/MatlabWorkspace/rs_cuboid_measure_script_python_attempt2/for_testing$ python2.7
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rs_cuboid_measure_script_python
>>> rs = rs_cuboid_measure_script_python.initialize()
>>> rs.rs_cuboid_measure_script_python()
Not enough input arguments. *this is OK this means my function is getting called*

我有一个确切的问题。同样的错误。使用Python2.7代替Python3.5对我来说也很管用。谢谢


然而,我真的很想知道如何使它在3.6上工作,因为我打算在3.6上运行的Django服务器上使用Matlab程序。

我也有同样的问题。已解决:

cd /full_path_to_matlab_mcrroot/v94/bin/glnxa64
mv libexpat.so.1 libexpat.so.1.NOFIND
多亏了

  • 说明:
/full\u path\u to\u matlab\u mcrroot/v94/bin/glnxa64/libexpat.so.1
指向
libexpat.so.1.5.0

但是


/lib/x86\u 64-linux-gnu/libexpat.so.1
指向
libexpat.so.1.6.0

什么对您有效?这应该是一个评论,而不是我所看到的答案。
:/usr/lib/x86_64-linux-gnu$ strings libpython3.6m.so.1.0 | grep Salt
XML_SetHashSalt
:~/MatlabWorkspace/rs_cuboid_measure_script_python_attempt2/for_testing$ python2.7
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rs_cuboid_measure_script_python
>>> rs = rs_cuboid_measure_script_python.initialize()
>>> rs.rs_cuboid_measure_script_python()
Not enough input arguments. *this is OK this means my function is getting called*
cd /full_path_to_matlab_mcrroot/v94/bin/glnxa64
mv libexpat.so.1 libexpat.so.1.NOFIND