简体   繁体   中英

Library not loaded: @rpath/libopenblasp-r0.2.19.dylib multiarray.cpython-36m-darwin.so Reason: image not found

I updated my Python through Conda and now I get this error. I had no problem before with Anaconda Python. What are some quick/easy fixes?

Monas-MacBook-Pro:P3 mona$ python k_means_clustering.py 
Traceback (most recent call last):
  File "/Users/mona/anaconda/lib/python3.6/site-packages/numpy/core/__init__.py", line 16, in <module>
    from . import multiarray
ImportError: dlopen(/Users/mona/anaconda/lib/python3.6/site-packages/numpy/core/multiarray.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libopenblasp-r0.2.19.dylib
  Referenced from: /Users/mona/anaconda/lib/python3.6/site-packages/numpy/core/multiarray.cpython-36m-darwin.so
  Reason: image not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "k_means_clustering.py", line 5, in <module>
    import matplotlib.pyplot as plt
  File "/Users/mona/anaconda/lib/python3.6/site-packages/matplotlib/__init__.py", line 122, in <module>
    from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
  File "/Users/mona/anaconda/lib/python3.6/site-packages/matplotlib/cbook.py", line 32, in <module>
    import numpy as np
  File "/Users/mona/anaconda/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/Users/mona/anaconda/lib/python3.6/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/Users/mona/anaconda/lib/python3.6/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/Users/mona/anaconda/lib/python3.6/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/Users/mona/anaconda/lib/python3.6/site-packages/numpy/core/__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: dlopen(/Users/mona/anaconda/lib/python3.6/site-packages/numpy/core/multiarray.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libopenblasp-r0.2.19.dylib
  Referenced from: /Users/mona/anaconda/lib/python3.6/site-packages/numpy/core/multiarray.cpython-36m-darwin.so
  Reason: image not found

Not sure why would that have happened after updating to Python 3.6.2 from Python 3.5.4 but this solved the issue for me.

Monas-MacBook-Pro:P3 mona$ conda install -c conda-forge openblas=0.2.19
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment /Users/mona/anaconda:

The following packages will be UPDATED:

    openblas:  0.2.19-1              --> 0.2.19-2                      conda-forge
    scipy:     0.19.1-py36h3e758e1_3 --> 0.19.1-py36_blas_openblas_202 conda-forge [blas_openblas]

The following packages will be SUPERSEDED by a higher-priority channel:

    conda:     4.3.27-py36hb556a21_0 --> 4.3.27-py36_0                 conda-forge
    conda-env: 2.6.0-h36134e3_0      --> 2.6.0-0                       conda-forge

Proceed ([y]/n)? y

conda-env-2.6. 100% |##################################################| Time: 0:00:00 814.91 kB/s
openblas-0.2.1 100% |##################################################| Time: 0:00:00  18.46 MB/s
conda-4.3.27-p 100% |##################################################| Time: 0:00:00   4.44 MB/s

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM