【问题标题】:installing scipy can't find fortran mac安装scipy找不到fortran mac
【发布时间】:2015-08-14 08:31:19
【问题描述】:

我在安装 scipy 时遇到了很大的麻烦。

当我跑步时: 点安装 scipy

我明白了:

Requirement already satisfied (use --upgrade to upgrade): scipy in 
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python

但是,当我在 python 中导入 scipy 时,我得到了 no module called 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

我做错了什么?

【问题讨论】:

    标签: python macos scipy


    【解决方案1】:

    您是否尝试过手动将 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
    

    同样,这些路径可能需要在您的系统上更改(取决于版本)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-04
      • 2013-01-27
      • 2012-07-05
      • 1970-01-01
      • 1970-01-01
      • 2014-09-24
      • 2011-06-13
      • 1970-01-01
      相关资源
      最近更新 更多