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

时间:2014-06-27 21:24:15

标签: 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.
==> 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.

2 个答案:

答案 0 :(得分:0)

看起来它遇到了fortran编译器的问题。当我使用OSX和Homebrew for SciPy时,我通常还会安装gfortran来编译SciPy中的fortran文件。

尝试做:

brew install gfortran

然后再试一次。

答案 1 :(得分:0)

要解决此问题,您必须使用其他版本的gfortran。详细解释here

您可能还想尝试使用.dmg安装程序availble here

进行安装