I had a similar problem, except that I was installing scipy in a virtualenv using pip install -r requirements.txt
, where one requirement was scipy==0.18.0
. I finally resolved it by deleting my pip caches and trying again.
More specifically, I did this:
- Deactivate the virtualenv
flask
sudo rm -r flask/
- Checked my PATH and PYTHONPATH environment variables carefully, getting rid of references to other projects and other Python versions
- Set my MacPorts Python version to 2.7, consistent with my project's needs:
Sudo port set python python27
- Delete my pip caches,
rm -r ~/Library/Caches/pip/http/* ~/Library/Caches/pip/wheels/*
- Recreated the virtualenv:
virtualenv flask
- Reactivated the virtualenv:
source flask/bin/activate
- Performed a
make
operation which invoked pip install -r requirements.txt
I came up with a shorthand for detecting the problem:
% python -c 'import scipy.special'
When the problem occurred, I got an error response:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/myuser/project/flask/lib/python2.7/site-packages/scipy/special/__init__.py", line 636, in <module>
from ._ufuncs import *
ImportError: dlopen(/Users/myuser/project/flask/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): Symbol not found: ___addtf3
Referenced from: /Users/myuser/project/flask/lib/python2.7/site-packages/scipy/special/../.dylibs/libquadmath.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /Users/myuser/project/flask/lib/python2.7/site-packages/scipy/special/../.dylibs/libquadmath.0.dylib
When the problem was corrected, there was no output.
When the test was run in an environment without scipy (e.g. outside the virtualenv), there was the expected error:
ImportError: No module named scipy.special
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…