2013-01-18 21 views
24

ho Python 2.7 in esecuzione e cercando di installare SciPy utilizzando easy_install che restituisce seguenti errori:Installazione SciPy su Ubuntu

Searching for scipy 
Reading http://pypi.python.org/simple/scipy/ 
Reading http://www.scipy.org 
Reading http://sourceforge.net/project/showfiles.php?group_id=27747&package_id=19531 
Reading http://new.scipy.org/Wiki/Download 
Best match: scipy 0.11.0 
Downloading http://pypi.python.org/packages/source/s/scipy/scipy-0.11.0.zip#md5=40b700ddde9ddab643b640fff7a9d753 
Processing scipy-0.11.0.zip 
Running scipy-0.11.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-49BQSz/scipy-0.11.0/egg-dist-tmp-KMjwKy 
Running from scipy source directory. 
/usr/lib64/python2.7/site-packages/numpy/distutils/system_info.py:1425: UserWarning: 
    Atlas (http://math-atlas.sourceforge.net/) libraries not found. 
    Directories to search for the libraries can be specified in the 
    numpy/distutils/site.cfg file (section [atlas]) or by setting 
    the ATLAS environment variable. 
    warnings.warn(AtlasNotFoundError.__doc__) 
/usr/lib64/python2.7/site-packages/numpy/distutils/system_info.py:1434: UserWarning: 
    Blas (http://www.netlib.org/blas/) libraries not found. 
    Directories to search for the libraries can be specified in the 
    numpy/distutils/site.cfg file (section [blas]) or by setting 
    the BLAS environment variable. 
    warnings.warn(BlasNotFoundError.__doc__) 
/usr/lib64/python2.7/site-packages/numpy/distutils/system_info.py:1437: UserWarning: 
    Blas (http://www.netlib.org/blas/) sources not found. 
    Directories to search for the sources can be specified in the 
    numpy/distutils/site.cfg file (section [blas_src]) or by setting 
    the BLAS_SRC environment variable. 
    warnings.warn(BlasSrcNotFoundError.__doc__) 
error: 
    Blas (http://www.netlib.org/blas/) libraries not found. 
    Directories to search for the libraries can be specified in the 
    numpy/distutils/site.cfg file (section [blas]) or by setting 
    the BLAS environment variable. 

Così ho installato Blas e Atalas eseguendo

apt-get install blas 
apt-get install atlas 

Tuttavia, il gli errori easy_install non scompaiono.

Grazie!

+1

provi? "sudo apt-get install python-numpy python-scipy" –

+0

Ho installato SciPy sul mio Mac con Python Package Installer e non ricordo di aver avuto problemi. Qualche ragione particolare per cui non puoi provare a installare pip (credo che il pip easy_install funzioni), e che lavori da lì? – BenDundee

+0

Utilizzo di apt-get install scipy Ottiene: E: Impossibile trovare il pacchetto python-numpy –

risposta

30

Ubuntu inserisce i file di libreria in una directory piuttosto esotica. /usr/lib/x86_64-linux-gnu/ o qualcosa, a seconda dell'architettura. È necessario aggiungere questa directory al file site.cfg o alla variabile di ambiente BLAS.

Se l'installazione semplice richiede anche i file di intestazione, è necessario installare i rispettivi pacchetti -dev.

Ma, come suggerito da @ pitsanu-swangpheaw, è possibile anche installare la directory dei pacchetti del sito utilizzando il gestore di pacchetti ubuntu.

sudo apt-get install python-numpy python-scipy 
+0

Come accennato sopra per qualche ragione apt-get non trova python-numpy. Ricevo "E: Impossibile trovare il pacchetto python-numpy" –

+1

È nel [repository universo] (https://help.ubuntu.com/community/Repositories/Ubuntu), forse è necessario abilitarlo nelle tue fonti elenco.Altrimenti, potrebbe esserci un problema con l'indice del pacchetto, che puoi aggiornare usando 'apt-get update'. Quale versione di Ubuntu stai usando? – flup

2

ho risolto il problema eseguendo (simile ai suggerimenti precedenti)

apt-get install scipy 
+0

Questo non funziona su 15.1 – JohnAllen

4

sudo apt-get install python-scipy lavorato nel mio caso.

67

cosa ha funzionato per me:

Per installare in realtà SciPy dal PIP, è necessario pacchetti libatlas-base-dev (librerie, ecc per ATLAS/BLAS) e gfortran (compilatore GNU Fortran).

Una volta installati questi pacchetti, l'installazione di scipy dovrebbe terminare come previsto.

+7

questa è la vera risposta. grazie – RussellStewart

+0

Davvero aiutami, grazie – huangcd

+1

Anche se l'OP ha chiesto di Ubuntu, questo succede anche a lavorare su Raspbian per il Raspberry Pi – Neil

5

Se si utilizza python3, potete installare i pacchetti utilizzando apt-get

sudo apt-get install python3-numpy python3-scipy 
3

Se si desidera installare ancora utilizzando pip, è possibile utilizzare build-dep per ottenere le dipendenze di python-NumPy e python-SciPy , e quindi installare utilizzando pip

sudo apt-get build-dep python-numpy python-scipy 

sostituto per python3 come lo stato altre risposte di questo è quello che stai cercando.

+0

molto utile per evitare di dover ricordare i pacchetti particolari che devono essere installati (come suggerito sopra) –

0

posso risolvere questo problema con la corsa:

sudo pip install scipy