When I was making the materials for the TA experiment, I needed to draw a map with python, so I was planning to practice it while I was planning to use cartopy, but I thought, "Would you like to use basemap as well?" , When I installed it, I got an import error of numpy and was impatient (I thought Anaconda3 was dead ...)
Well, the reason why I thought about it is that when plotting the epicenter and observation points with obspy (seismic wave analysis module), it seems necessary to import the baseline. .. ..
Then, when I run the code after installing it, I get the following error. ..
numpy_error.py
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/core/__init__.py", line 22, in <module>
from . import multiarray
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/core/multiarray.py", line 12, in <module>
from . import overrides
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
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:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/__init__.py", line 140, in <module>
from . import core
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/core/__init__.py", line 48, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.7 from "/opt/anaconda3/bin/python"
* The NumPy version is: "1.19.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
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
I thought this was something, so I tried quite a lot.
・ Upgrade conda ・ Reinsert numpy
etc. .. I didn't want to reinstall anaconda3 if possible. I've customized it a lot, and I don't even know what to put in again. .. .. Well, the solution was solved by reading the beginning of the error properly.
initial_error.py
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/core/__init__.py", line 22, in <module>
from . import multiarray
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/core/multiarray.py", line 12, in <module>
from . import overrides
File "/opt/anaconda3/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
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
Well, all I had to do was put in "openblas". It seems like it was originally included? I thought, but this solved it for the time being.
Recommended Posts