>>> import scipy.stats
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/__init__.py", line 334, in <module>
from .stats import *
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/stats.py", line 186, in <module>
from . import distributions
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/distributions.py", line 10, in <module>
from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
File "/usr/local/lib/python2.7/dist-packages/scipy/stats/_distn_infrastructure.py", line 22, in <module>
from scipy import optimize
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/__init__.py", line 165, in <module>
from ._root import *
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/_root.py", line 20, in <module>
from . import nonlin
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/nonlin.py", line 122, in <module>
import scipy.sparse.linalg
File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/__init__.py", line 110, in <module>
from .dsolve import *
File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/__init__.py", line 60, in <module>
from .linsolve import *
File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/linsolve.py", line 10, in <module>
from . import _superlu
ImportError: /usr/local/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/_superlu.so: undefined symbol: ATL_cpttrsm
导入scipy.stats会出现上述错误。我最近安装了Python anaconda。我已经尝试重新安装numpy和scipy但无济于事。我正在使用 Ubuntu 14.04
命令&#34; -a python&#34;将以下行作为输出: -
/home/abhishek/anaconda/bin/python
/usr/bin/python
答案 0 :(得分:1)
你应该取消设置PYTHONPATH
。它导致您的Anaconda Python获取安装在/ usr / local中的软件包而不仅仅是Anaconda软件包(应该可以正常工作)。
答案 1 :(得分:0)
有人向我指出,/ usr / local /中的scipy安装已被破坏,我需要将其卸载。
sudo pip uninstall scipy
这解决了问题。