簡體   English   中英

在Ubuntu上安裝SciPy

[英]Installing SciPy on Ubuntu

我運行Python 2.7並嘗試使用easy_install安裝scipy,它返回以下錯誤:

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.

所以我通過執行安裝了Blas和Atalas

apt-get install blas
apt-get install atlas

但是,easy_install錯誤不會消失。

謝謝!

什么對我有用:

要從PIP實際安裝scipy,您需要包libatlas-base-dev (用於ATLAS / BLAS的庫等)和gfortran (GNU Fortran編譯器)。

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

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

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

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

sudo apt-get install python-numpy python-scipy

如果您使用的是Python3,則可以使用apt-get安裝軟件包

sudo apt-get install python3-numpy python3-scipy

sudo apt-get install python-scipy在我的情況下工作。

如果你仍想使用pip進行安裝,可以使用build-dep來獲取python-numpy和python-scipy的依賴關系,然后使用pip進行安裝

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

替換python3作為另一個回答狀態你正在尋找。

我通過運行解決了這個問題(類似於以前的建議)

apt-get install scipy

我通過運行來解決這個問題:

sudo pip install scipy

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM