The Python Oracle

Installing SciPy and NumPy using pip

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Island

--

Chapters
00:00 Question
01:15 Accepted answer (Score 34)
02:09 Answer 2 (Score 333)
02:25 Answer 3 (Score 77)
02:41 Answer 4 (Score 14)
03:04 Thank you

--

Full question
https://stackoverflow.com/questions/1111...

Question links:
[SciPy]: http://en.wikipedia.org/wiki/SciPy
[NumPy]: http://en.wikipedia.org/wiki/NumPy

Accepted answer links:
[Installing SciPY]: http://www.scipy.org/Installing_SciPy/Bu...
[BLAS]: http://en.wikipedia.org/wiki/Basic_Linea...
[LAPACK]: http://en.wikipedia.org/wiki/LAPACK
[Fortran]: http://en.wikipedia.org/wiki/Fortran

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #numpy #scipy #pip #apt

#avk47



ANSWER 1

Score 333


This worked for me on Ubuntu 14.04:

sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
pip install scipy



ANSWER 2

Score 77


you need the libblas and liblapack dev packages if you are using Ubuntu.

aptitude install libblas-dev liblapack-dev
pip install scipy



ACCEPTED ANSWER

Score 34


I am assuming Linux experience in my answer; I found that there are three prerequisites to getting pip install scipy to proceed nicely.

Go here: Installing SciPY

Follow the instructions to download, build and export the env variable for BLAS and then LAPACK. Be careful to not just blindly cut'n'paste the shell commands - there will be a few lines you need to select depending on your architecture, etc., and you'll need to fix/add the correct directories that it incorrectly assumes as well.

The third thing you may need is to yum install numpy-f2py or the equivalent.

Oh, yes and lastly, you may need to yum install gcc-gfortran as the libraries above are Fortran source.




ANSWER 4

Score 7


I was working on a project that depended on numpy and scipy. In a clean installation of Fedora 23, using a python virtual environment for Python 3.4 (also worked for Python 2.7), and with the following in my setup.py (in the setup() method)

setup_requires=[
    'numpy',
],
install_requires=[
    'numpy',
    'scipy',
],

I found I had to run the following to get pip install -e . to work:

pip install --upgrade pip

and

sudo dnf install atlas-devel gcc-{c++,gfortran} subversion redhat-rpm-config

The redhat-rpm-config is for scipy's use of redhat-hardened-cc1 as opposed to the regular cc1