gpt4 book ai didi

python - Matlab Engine Python - OSx Anaconda Segfault 或 iPython 的 DYLD_LIBRARY_PATH 错误

转载 作者:太空宇宙 更新时间:2023-11-03 12:06:06 27 4
gpt4 key购买 nike

在终端中安装 matlab python 包后使用:

cd "matlabroot\extern\engines\python"
python setup.py install

尝试运行它时,出现段错误:

:~$ python
Python 2.7.10 |Anaconda 2.3.0 (x86_64)| (default, May 28 2015, 17:04:42)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import matlab.engine
Segmentation fault: 11

但是,我可以通过设置 DYLD_LIBRARY_PATH 来解决这个问题,之后 matlab.engine 开始工作:

:~$ export DYLD_LIBRARY_PATH=/System/Library/Frameworks/Python.framework/Versions/Current/lib:$DYLD_LIBRARY_PATH
:~$ python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matlab.engine
>>> eng = matlab.engine.start_matlab()
>>> exit()

但是,当我之后尝试启动 iPython 时,出现了这个错误:

Traceback (most recent call last):
File "//anaconda/bin/ipython", line 4, in <module>
from IPython import start_ipython
File "//anaconda/lib/python2.7/site-packages/IPython/__init__.py", line 45, in <module>
from .config.loader import Config
File "//anaconda/lib/python2.7/site-packages/IPython/config/__init__.py", line 6, in <module>
from .application import *
File "//anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 19, in <module>
from IPython.config.configurable import SingletonConfigurable
File "//anaconda/lib/python2.7/site-packages/IPython/config/configurable.py", line 12, in <module>
from .loader import Config, LazyConfigValue
File "//anaconda/lib/python2.7/site-packages/IPython/config/loader.py", line 16, in <module>
from IPython.utils.path import filefind, get_ipython_dir
File "//anaconda/lib/python2.7/site-packages/IPython/utils/path.py", line 14, in <module>
import tempfile
File "//anaconda/lib/python2.7/tempfile.py", line 32, in <module>
import io as _io
File "//anaconda/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: dlopen(//anaconda/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
Referenced from: //anaconda/lib/python2.7/lib-dynload/_io.so
Expected in: dynamic lookup

如您所见,python 版本不同。我认为这是我的系统 Python 和 Anaconda 之间的冲突,但我不确定如何解决它,非常感谢任何帮助。谢谢。

最佳答案

您需要使用 conda 命令行安装实用程序而不是 python 安装库。 conda help searchconda help install 应该让你开始。

关于python - Matlab Engine Python - OSx Anaconda Segfault 或 iPython 的 DYLD_LIBRARY_PATH 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31908768/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com