26
votes

I have Python 2.7 running and trying to install scipy by using easy_install which returns following errors:

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.

So I installed Blas and Atalas by executing

apt-get install blas
apt-get install atlas

However, the easy_install errors don't disappear.

Thanks!

7
do you try? "sudo apt-get install python-numpy python-scipy" - Pitsanu Swangpheaw
I installed SciPy on my Mac with the Python Package Installer and don't remember having any trouble. Any particular reason you can't try installing pip (I think easy_install pip works), and working from there? - BenDundee
Using apt-get install scipy I get: E: Couldn't find package python-numpy - Jack Gibson
Using pip I get the similar blas related errors - Jack Gibson

7 Answers

30
votes

Ubuntu puts library files in a rather exotic directory. /usr/lib/x86_64-linux-gnu/ or something, depending on your architecture. You need to add this directory to the site.cfg file or the BLAS environment variable.

If easy install also needs the header files, you need to install the respective -dev packages.

But, like @pitsanu-swangpheaw suggests, you can also install to the site packages directory using the ubuntu package manager.

sudo apt-get install python-numpy python-scipy
72
votes

What worked for me:

To actually install scipy from PIP, you need packages libatlas-base-dev (libraries etc. for ATLAS/BLAS) and gfortran (GNU Fortran compiler).

Once these packages are installed, the scipy installer should finish as expected.

5
votes

If you are using Python3, You can install packages using apt-get

sudo apt-get install python3-numpy python3-scipy
4
votes

sudo apt-get install python-scipy worked in my case.

4
votes

If you want to still install using pip, you can use build-dep to get the dependencies of python-numpy and python-scipy, and then install using pip

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

Substitute for python3 as the other answers state of that's what you're looking for.

2
votes

I solved the issue by running (similar to previous suggestions)

apt-get install scipy
0
votes

I solve this problem with running:

sudo pip install scipy