New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import numpy fails because libopenblas.dylib does not load #14165
Comments
I tried some of my other conda environments, and I can import numpy in all of the environments that have a version of openblas prior to 0.3.6. I rolled back my openblas version in the environment that produced the error to 0.3.3 with numpy 1.16.4, and there is no longer a problem importing numpy. It seems like the problem is due to something in openblas 0.3.6. |
FWIW, libopenblas 0.3.6 names the dynamic library |
Hey @jriehl, how do you mean, please? |
I faced this issue while trying to install numpy 1.18.1 in virtualenv with python 3.7.6. The problem was that I did not have numpy installed in the base os. Once I installed numpy in the base mac OS and reinstalled numpy in the virtualenv it worked. |
I lost track of this issue some time ago. Sorry. Some time ago I made a fresh install of Anaconda with the default configuration, and I no longer have the problem. This default anaconda install does not include openblas. Here is my version information:
|
This also occurs to me with python 3.7.8 and numpy 1.19.1 and not fully resolved yet. I tried linking libopenblas.dylib to libopenblas.0.dylib (which itself is linked to the current libopenblas, for instance, libopenblasp-r0.3.10.dylib) but still does not work. The only way I get it working is to conda install blas=1.1 instead of current 2.x. Many thanks if you have any suggestions.
|
@zezhong-zhang please open a new issue, this is closed. Be sure to read https://numpy.org/devdocs/user/troubleshooting-importerror.html and if that does not help, report the entire error. |
When I try to import numpy, it fails with the following error message.
I get this error on a fresh anaconda install from the conda-forge repo on Mac OS X. Numpy has worked on this computer before my most recent update.
Note that my computer is a MacBook Pro running Mac OS X 10.14.6, but I get the same error on an older Mac Pro running Mac OS X 10.13.6.
Reproducing code example:
Error message:
ImportError Traceback (most recent call last)
/opt/anaconda3/lib/python3.7/site-packages/numpy/core/init.py in
39 try:
---> 40 from . import multiarray
41 except ImportError as exc:
/opt/anaconda3/lib/python3.7/site-packages/numpy/core/multiarray.py in
11
---> 12 from . import overrides
13 from . import _multiarray_umath
/opt/anaconda3/lib/python3.7/site-packages/numpy/core/overrides.py in
5
----> 6 from numpy.core._multiarray_umath import (
7 add_docstring, implement_array_function, _get_implementing_args)
ImportError: dlopen(/opt/anaconda3/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
Referenced from: /opt/anaconda3/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so
Reason: image not found
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
in
----> 1 import numpy as np
/opt/anaconda3/lib/python3.7/site-packages/numpy/init.py in
140 from . import _distributor_init
141
--> 142 from . import core
143 from .core import *
144 from . import compat
/opt/anaconda3/lib/python3.7/site-packages/numpy/core/init.py in
69 Original error was: %s
70 """ % (sys.executable, exc)
---> 71 raise ImportError(msg)
72 finally:
73 for envkey in env_added:
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
git clean -xdf
(removes all files not under version control) and rebuild numpy.
your installation is broken - please reinstall numpy.
Check that you are using the Python you expect (you're using /opt/anaconda3/bin/python),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: dlopen(/opt/anaconda3/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
Referenced from: /opt/anaconda3/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so
Reason: image not found
Numpy/Python version information:
Note that importing numpy causes the error, so I cannot do an
import numpy; print(numpy.__version__)
. Runningconda list
gives the numpy version as 1.16.4 and the build as py36h926163e_0.The text was updated successfully, but these errors were encountered: