Can't “import numpy” after fresh install Anaconda3 on Mac

こ雲淡風輕ζ 提交于 2020-02-25 04:13:48

问题


Errors: (summary, details below)

  • Anaconda installer says that install failed, but won't show the details.
  • When I try to reinstall, it says Anaconda is already installed into ~/opt/anaconda3, which it is there
  • python -> import numpy -> Symbol not found: ___addtf3

Environment:

  • iMac, macOS Catalina 10.15.2
  • I did do the conda init bash and it seemed to work when I opened a new terminal tab
  • which python -> opt/anaconda3/bin/python
  • echo $DYLD_LIBRARY_PATH -> /opt/subversion/lib:/usr/lib:

Oddly in the errors below it's referencing files in /usr/local/lib/python3.7/site-packages/numpy/... but as I said, when I run Python, it starts off with the correct python in ~/opt/anaconda3/bin version, so I don't think it should be looking at /usr/local/lib at all should it??

Full Errors from import numpy:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/numpy/core/__init__.py", line 24, in <module>
    from . import multiarray
  File "/usr/local/lib/python3.7/site-packages/numpy/core/multiarray.py", line 14, in <module>
    from . import overrides
  File "/usr/local/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: dlopen(/usr/local/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2): Symbol not found: ___addtf3
  Referenced from: /usr/local/lib/python3.7/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /usr/local/lib/python3.7/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/usr/local/lib/python3.7/site-packages/numpy/core/__init__.py", line 54, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.7 from "/usr/local/opt/python/bin/python3.7",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.1" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

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(/usr/local/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2): Symbol not found: ___addtf3
  Referenced from: /usr/local/lib/python3.7/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /usr/local/lib/python3.7/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib

来源:https://stackoverflow.com/questions/59818694/cant-import-numpy-after-fresh-install-anaconda3-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!