Whenever I attempt to run this code:
from scipy.special import legendre
I keep encountering the following error.
ImportError: dlopen(/Users/william/miniconda/envs/myenv/lib/python3.4/site-packages/scipy/special/_ufuncs.so, 2): Symbol not found: ___addtf3 Referenced from: /Users/william/miniconda/envs/prakenv/lib/python3.4/site-packages/scipy/special/_ufuncs.so Expected in: /usr/lib/libSystem.B.dylib
I've tried reverting to previous versions of scipy and using a Python 2.7 conda environment, but the problem persists. I have ever not had this problem before with scipy. Thank you very much!
There was apparently a problem with conda v 3.15.0 which caused these symptoms. The fix was to release conda v 3.15.1 on 2015-07-23, and have people re-install.
See discussion at conda issue #1467, Error in scipy 0.16 packaging in official conda channels on OSX. Given the timing of your question, just a few days later in July 2015, this might have affected you.
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
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:
- Reactivated the virtualenv:
- Performed a
makeoperation 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
I have a temporary fix (reverting scipy), although I would prefer to determine the exact cause of the problem:
conda uninstall scipy conda install scipy=0.15.0
This is on Yosemite running in a Python 3.4 miniconda environment.