在Mac OS X上安装gcc之后,仍然无法安装scipy,因为缺少fortran编译器 [英] Still can't install scipy due to missing fortran compiler after brew install gcc on Mac OS X

查看:956
本文介绍了在Mac OS X上安装gcc之后,仍然无法安装scipy,因为缺少fortran编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读并遵循此答案来安装scipy / numpy / theano。但是,在brew安装gcc之后,它仍然失败了Fortran编译器缺少的错误。虽然HomeBrew安装了gcc-4.8,但它没有安装任何gfortran或g95命令。我认为gfortran可能只是一个同义词的gcc,然后我创建一个符号链接

$ $ p $ $ $ $ $ cd / usr / local / bin
$ ln -s gcc -4.8 gfortran
$ pip install scipy

然后它检测到gfortran命令但仍然抱怨不Fortran编译器

 自定义Gnu95FCompiler 
找到可执行文件/ usr / local / bin / gfortran
自定义NAGFCompiler
无法找到可执行文件f95
自定义AbsoftFCompiler
找不到可执行文件f90
无法找到可执行文件f77
自定义IBMFCompiler
无法找到可执行文件xlf90
无法找到可执行文件xlf
自定义IntelFCompiler
无法找到可执行文件ifort
无法找到可执行文件ifc
自定义GnuFCompiler
找不到可执行文件g77
自定义G95FCompiler
找不到e xecutable g95
自定义PGroupFCompiler
无法找到可执行文件pgfortran
不知道如何在平台'posix'上编译Fortran代码
建立'dfftpack'库
错误:库dfftpack有Fortran源代码,但没有发现Fortran编译器

我还应该做什么?

解决方案

通过升级pip修复,尽管我刚刚在同一天第一次安装了我的pip / virtualenv。 p>

 (mypy)MAC0227:$ pip install --upgrade pip 
...
(mypy)MAC0227: $ pip install theano
/Users/me/.virtualenvs/mypy/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79:InsecurePlatformWarning:一个true SSLContext对象不可用。这可以防止urllib3正确配置SSL,并可能导致某些SSL连接失败。有关更多信息,请参阅https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning。
InsecurePlatformWarning
需求已满足(使用--upgrade升级):/Users/me/.virtualenvs/mypy/lib/python2.7/site-packages
中的theano已满足要求(使用--upgrade升级):numpy> = 1.6.2 in /Users/me/.virtualenvs/mypy/lib/python2.7/site-packages(from theano)
收集scipy> = 0.11(来自theano )
/Users/me/.virtualenvs/mypy/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79:InsecurePlatformWarning:一个真正的SSLContext对象是无法使用。这可以防止urllib3正确配置SSL,并可能导致某些SSL连接失败。有关更多信息,请参阅https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning。
InsecurePlatformWarning
下载scipy-0.15.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl(19.8MB)
100%|████████ ████████████████████████| 19.8MB 23kB / s
安装收集的软件包:scipy
成功安装scipy-0.15.1


I have read and followed this answer to install scipy/numpy/theano. However, it still failed on the same error of missing Fortran compiler after brew install gcc. While HomeBrew installed the gcc-4.8, it didn't install any gfortran or g95 commands. I figure gfortran may be just a synonymy of gcc, then I create a symlink

$ cd /usr/local/bin
$ ln -s gcc-4.8 gfortran
$ pip install scipy

Then it detects the gfortran command but still complaining no Fortran compiler

customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
customize NAGFCompiler
Could not locate executable f95
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Could not locate executable g77
customize G95FCompiler
Could not locate executable g95
customize PGroupFCompiler
Could not locate executable pgfortran
don't know how to compile Fortran code on platform 'posix'
building 'dfftpack' library
error: library dfftpack has Fortran sources but no Fortran compiler found

What else should I do?

解决方案

Fixed by upgrading pip, even though I just installed my pip/virtualenv the first time anew on the same day.

(mypy)MAC0227: $ pip install --upgrade pip
...
(mypy)MAC0227: $ pip install theano
/Users/me/.virtualenvs/mypy/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Requirement already satisfied (use --upgrade to upgrade): theano in /Users/me/.virtualenvs/mypy/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.2 in /Users/me/.virtualenvs/mypy/lib/python2.7/site-packages (from theano)
Collecting scipy>=0.11 (from theano)
/Users/me/.virtualenvs/mypy/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading scipy-0.15.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (19.8MB)
    100% |████████████████████████████████| 19.8MB 23kB/s
Installing collected packages: scipy
Successfully installed scipy-0.15.1

这篇关于在Mac OS X上安装gcc之后,仍然无法安装scipy,因为缺少fortran编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆