在Macbook M1上的Scikit-learn,安装了gcc 12,“/opt/homebrew/opt/gcc/lib/gcc/11/libgfortran.5.dylib”(没有这样的文件)

d8tt03nd  于 2022-11-13  发布在  Mac
关注(0)|答案(1)|浏览(268)

尝试安装Scikit-learn在蒙特里Macbook Pro M1。似乎安装确定,但当我运行eg

import sklearn

我得到了错误,

ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/scipy/linalg/_fblas.cpython-39-darwin.so, 0x0002): Library not loaded: '/opt/homebrew/opt/gcc/lib/gcc/11/libgfortran.5.dylib'
  Referenced from: '/opt/homebrew/lib/python3.9/site-packages/scipy/linalg/_fblas.cpython-39-darwin.so'
  Reason: tried: '/opt/homebrew/opt/gcc/lib/gcc/11/libgfortran.5.dylib' (no such file), '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file)

我确实有libgfortran.5.dylb,

locate libgfortran.5.dylib                                                                                       ✔  5   06:15:39   780 Mbps 
/opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.5.dylib
/opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.5.dylib
/opt/homebrew/lib/python3.10/site-packages/numpy/.dylibs/libgfortran.5.dylib
/usr/local/Cellar/gcc/11.1.0/lib/gcc/11/libgfortran.5.dylib

我有一个路径问题吗?。搜索周围我看到一些旧的解决方案链接相关的库。我该怎么做?

vjhs03f7

vjhs03f71#

这一招奏效了。)

pip install --upgrade --force-reinstall scikit-learn

相关问题