2013-01-18 30 views
24

安裝SciPy的我的Python 2.7運行,並試圖通過使用easy_install的返回下列錯誤安裝SciPy的:在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. 

因此,我安裝布拉斯和Atalas通過執行

apt-get install blas 
apt-get install atlas 

然而, easy_install錯誤不會消失。

謝謝!

+1

你試試? 「sudo apt-get install python-numpy python-scipy」 –

+0

我用Python Package Installer在我的Mac上安裝了SciPy,不記得有任何問題。任何特定的原因,你不能嘗試安裝點子(我認爲easy_install點子作品),並從那裏工作? – BenDundee

+0

使用apt-get安裝scipy我得到: E:找不到軟件包python-numpy –

回答

30

Ubuntu將庫文件放在一個相當奇特的目錄中。 /usr/lib/x86_64-linux-gnu/什麼,取決於你的架構。 您需要將此目錄添加到site.cfg文件或BLAS環境變量。

如果安裝簡單也需要頭文件,則需要安裝相應的-dev軟件包。

但是,像@ pitsanu-swangpheaw建議的那樣,您也可以使用ubuntu軟件包管理器安裝到站點packages目錄。

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

如上所述,由於某種原因apt-get沒有找到python-numpy。我得到了「E:找不到軟件包python-numpy」 –

+1

它位於[universe repository](https://help.ubuntu.com/community/Repositories/Ubuntu)中,也許你需要在你的源代碼中啓用它名單。否則,它可能是你的軟件包索引的一個問題,你可以使用'apt-get update'進行更新。你運行的是哪個版本的Ubuntu? – flup

2

我通過運行(類似於以前的建議)

apt-get install scipy 
+0

這不適用於15.1 – JohnAllen

4

sudo apt-get install python-scipy在我的工作的情況下解決這一問題。

67

什麼工作對我來說:

要真正從PIP安裝SciPy的,你需要的包libatlas-base-dev(庫等,爲ATLAS/BLAS)和gfortran(GNU Fortran編譯)。

安裝這些軟件包後,scipy安裝程序應按預期完成。

+7

這是真正的答案。謝謝 – RussellStewart

+0

真的幫我,謝謝 – huangcd

+1

儘管OP詢問了關於Ubuntu的問題,這也適用於Raspberry的RaspberryPi – Neil

5

如果使用的是Python3,您可以使用apt-get

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

如果你想仍然使用pip安裝,您可以使用集結出發得到的python-numpy的和python-SciPy的的依賴安裝軟件包,然後安裝使用pip

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

爲替python3作爲的,其他的答案狀態就是你要找的東西。

+0

非常有用,可以避免必須記住需要安裝的特定軟件包(如上所述) –

0

我解決這個問題,運行:

sudo pip install scipy