安装 scipy 找不到 fortran mac
installing scipy can't find fortran mac
我在安装 scipy 时遇到了很大的麻烦。
当我运行:
点安装 scipy
我得到:
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
同样,这些路径可能需要在您的系统上更改(取决于版本)
我在安装 scipy 时遇到了很大的麻烦。
当我运行: 点安装 scipy
我得到:
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
同样,这些路径可能需要在您的系统上更改(取决于版本)