python virtualenv scipy import error undefined name
Question: I just started using virtualenv for my existing python project and ran into
some trouble...

When I try to import the following

    
    
    from scipy.sparse.linalg import spsolve
    

it causes an import error if a virtualenv is activated

    
    
    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_
    

When I use the global site-packages I don't get the error.

Can someone help me?


Answer: It appears there's some sort of trouble between numpy-1.10.2 and scipy (see
[here](https://github.com/scikit-learn/scikit-
learn/issues/6115#issuecomment-172272208)). Try the following (it fixed it for
me):

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

