Python 使用brew在osx上安装scipy时出错

Python 使用brew在osx上安装scipy时出错,python,macos,numpy,scipy,fortran,Python,Macos,Numpy,Scipy,Fortran,我正在尝试使用brew在我的osx 10.9计算机上安装scipy,但安装一直失败: administrators-iMac-3:sourcefind_python bill$ brew install scipy --default-fortran-flags ==> Using Homebrew-provided fortran compiler. This may be changed by setting the FC environment variable. ==> Bu

我正在尝试使用brew在我的osx 10.9计算机上安装scipy,但安装一直失败:

administrators-iMac-3:sourcefind_python bill$ brew install scipy --default-fortran-flags
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Building with an alternative Fortran compiler
This is unsupported.
Warning: No Fortran optimization information was provided.  You may want to consider
setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
`brew install` if your compiler is compatible with GCC.

If you like the default optimization level of your compiler, ignore this
warning.
==> Downloading https://downloads.sourceforge.net/project/scipy/scipy/0.13.3/scipy-0.13.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/scipy-0.13.3.tar.gz
==> python setup.py build --fcompiler=gnu95 install --prefix=/usr/local/Cellar/scipy/0.13.3_1
  Referenced from: /usr/local/Cellar/gcc/4.8.3_1/libexec/gcc/x86_64-apple-darwin13.2.0/4.8.3/f951
  Reason: image not found
gfortran: internal compiler error: Trace/BPT trap: 5 (program f951)
sh: line 1:  9597 Abort trap: 6           /usr/local/bin/gfortran -Wall -ffixed-form -fno-second-underscore -ff2c -O3 -funroll-loops -I/usr/local/lib/python2.7/site-packages/numpy/core/include -c -c scipy/fftpack/src/dfftpack/dcosqb.f -o build/temp.macosx-10.9-x86_64-2.7/scipy/fftpack/src/dfftpack/dcosqb.o
error: Command "/usr/local/bin/gfortran -Wall -ffixed-form -fno-second-underscore -ff2c -O3 -funroll-loops -I/usr/local/lib/python2.7/site-packages/numpy/core/include -c -c scipy/fftpack/src/dfftpack/dcosqb.f -o build/temp.macosx-10.9-x86_64-2.7/scipy/fftpack/src/dfftpack/dcosqb.o" failed with exit status 134

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/samueljohn/homebrew-python/issues
我安装了gcc,它应该包含gfortran:

administrators-iMac-3:sourcefind_python bill$ brew install gfortran
Error: No available formula for gfortran
GNU Fortran is now provided as part of GCC, and can be installed with:
  brew install gcc

administrators-iMac-3:sourcefind_python bill$ brew install gcc
Warning: gcc-4.8.3_1 already installed
应该有:

administrators-iMac-3:sourcefind_python bill$ gfortran
gfortran: fatal error: no input files
compilation terminated.

看起来fortran编译器有问题。当我使用OSX和Homebrew for SciPy时,我通常也会安装gfortran以在SciPy中编译fortran文件

试着做:

brew install gfortran

然后重试。

要解决此问题,您必须使用另一版本的
gfortran
。文中给出了详细的解释


您可能还想尝试使用可用的.dmg安装程序进行安装

谢谢,我应该通过brew install gcc安装gfortran(我想)是否有任何方法进行测试?如果您从命令行运行
gfortran
,它应该响应没有/没有不正确的输入文件。否则未安装或系统找不到它。试试这个?根据个人经验,我必须单独安装gfortran。我相信这是因为在安装gcc时,它允许gcc编译fortran文件,但是SciPy专门寻找gfortran。我假设您在没有默认fortran标志选项的情况下尝试过它?这本不必要;scipy通常与酿造的gfortran(来自gcc配方)配合使用。这里有一个建议:重新安装libmpc。