Я получаю эту ошибку при импорте sklearn. ImportError говорит, что не может загрузить libopenbl asp -r0.3.5.dylib. Я не уверен, почему он не загружается.
Я создаю символические ссылки из других предложений до сих пор не могу понять это. Я использовал pip для установки scikit-learn в macOS.
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/sklearn/__init__.py", line 82, in <module>
from .base import clone
File "/usr/local/lib/python3.7/site-packages/sklearn/base.py", line 20, in <module>
from .utils import _IS_32BIT
File "/usr/local/lib/python3.7/site-packages/sklearn/utils/__init__.py", line 27, in <module>
from .fixes import np_version
File "/usr/local/lib/python3.7/site-packages/sklearn/utils/fixes.py", line 18, in <module>
import scipy.stats
File "/usr/local/lib/python3.7/site-packages/scipy/stats/__init__.py", line 367, in <module>
from .stats import *
File "/usr/local/lib/python3.7/site-packages/scipy/stats/stats.py", line 172, in <module>
import scipy.special as special
File "/usr/local/lib/python3.7/site-packages/scipy/special/__init__.py", line 641, in <module>
from ._ufuncs import *
ImportError: dlopen(/usr/local/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.5.dylib
Referenced from: /usr/local/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so
Reason: image not found
brew info openblas
Optimized BLAS library
https://www.openblas.net/
/usr/local/Cellar/openblas/0.3.6_1 (21 files, 120MB)
Poured from bottle on 2019-07-24 at 17:27:55
/usr/local/Cellar/openblas/0.3.9 (22 files, 119.7MB)
Poured from bottle on 2020-03-27 at 13:46:01
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openblas.rb
==> Dependencies
Required: gcc ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
openblas is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS and LAPACK in the Accelerate framework.
For compilers to find openblas you may need to set:
export LDFLAGS="-L/usr/local/opt/openblas/lib"
export CPPFLAGS="-I/usr/local/opt/openblas/include"
For pkg-config to find openblas you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"