python virtualenv scipy导入错误未定义的名称

时间:2016-01-21 15:12:30

标签: python scipy virtualenv

我刚刚开始在我现有的python项目中使用virtualenv并遇到了一些麻烦......

当我尝试导入以下内容时

from scipy.sparse.linalg import spsolve

如果激活virtualenv会导致导入错误

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../lib/python2.7/site-packages/scipy/sparse/linalg/__init__.py", line 110, in <module>
from .dsolve import *
File ".../lib/python2.7/site-packages/scipy/sparse/linalg/dsolve/__init__.py", line 60, in <module>
from .linsolve import *
File ".../lib/python2.7/site-packages/scipy/sparse/linalg/dsolve/linsolve.py", line 10, in <module>
from . import _superlu
ImportError: .../lib/python2.7/site-packages/scipy/sparse/linalg/dsolve/_superlu.so: undefined symbol: dtrsm_

当我使用全球网站套餐时,我不会收到错误。

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

numpy-1.10.2和scipy之间似乎存在某种麻烦(参见here)。尝试以下(它为我修复):

(ve) $ pip install numpy==1.10.1
(ve) $ pip install --upgrade --force-reinstall scipy
(ve) $ python
>>> from scipy.sparse.linalg import spsolve