我在安装scipy时遇到了很大的麻烦。
当我运行:PIP安装脚本
我得到:
Requirement already satisfied (use --upgrade to upgrade): scipy in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
然而,当我在python中导入scipy时,我得到没有模块称为scipy错误。
当我尝试通过easy_install scipy,它开始下载,然后给我:
error: Setup script exited with error: library dfftpack has Fortran sources but no Fortran compiler found
当我尝试通过brew安装gfortran时,我得到:brew gfortran
Error: No available formula for gfortran
GNU Fortran is now provided as part of GCC, and can be installed with:
brew install gcc
但是当我尝试这样做时,我得到:
(py)Shopkicks-MacBook-Air-12:shopkick markthornburg$ brew install gcc
Warning: gcc-5.2.0 already installed, it's just not linked
我做错了什么?
您是否尝试过手动链接gfortran到/usr/local/bin
,例如:
ln -s /usr/local/Cellar/gfortran/4.8.2/bin/gfortran /usr/local/bin/
您可能需要根据安装的版本将路径替换为gfortran。
你可能还想设置:
export LD_LIBRARY_PATH=/usr/local/Cellar/gfortran/4.8.2/gfortran/lib:$LD_LIBRARY_PATH
export CPLUS_INCLUDE_PATH=/usr/local/Cellar/gfortran/4.8.2/gfortran/include/c++/4.8.2:$CPLUS_INCLUDE_PATH
同样,这些路径可能需要在您的系统上更改(取决于版本)