2015-04-12 8 views
25

Ho letto e seguito this answer per installare scipy/numpy/theano. Tuttavia, ha comunque fallito lo stesso errore del compilatore Fortran mancante dopo brew install gcc. Mentre HomeBrew ha installato gcc-4.8, non ha installato alcun comando gfortran o g95. Immagino gfortran può essere solo un synonymy di gcc, allora creo un link simbolicoImpossibile installare scipy a causa della mancanza del compilatore fortran dopo brew install gcc su Mac OS X

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

Poi rileva il comando gfortran ma ancora lamentarsi senza compilatore Fortran

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 

Che altro devo fare?

+0

Vuoi davvero compilare 'scipy' o utilizza una versione precompilata come spedito con' anaconda' un'opzione per voi? – cel

+2

Il comando gfortran chiama una cosa comune come fa gcc, ma poi chiama il frontend di Fortran e devi installarlo. Symlink gfortran → gcc non è abbastanza. –

+0

Hai fatto 'brew install gcc'? http://stackoverflow.com/questions/26919450/can-not-install-gfortran-via-homebrew –

risposta

33

Risolto aggiornando pip, anche se ho appena installato il mio pip/virtualenv la prima volta di nuovo nello stesso giorno.

(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 
21

Di seguito ha lavorato per me:

sudo apt-get install gfortran

sul mio sistema:

Ubuntu 15.10 (Linux 4.2.0-19-generiC# 23-Ubuntu x86_64 x86_64 x86_64 GNU/Linux)

+3

OP chiesto su OS X. – Blaszard

+0

In ogni caso, questo ha funzionato per me su Ubuntu piuttosto che aggiornare pip. –

Problemi correlati