How to install Scipy with pip on Mac Mountain Lion OS X v10.8

前端 未结 9 1671
天涯浪人
天涯浪人 2020-12-03 14:13

I\'m having serious difficulty installing Scipy with pip on Mountain Lion. I\'ve tried:

sudo pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev
         


        
相关标签:
9条回答
  • 2020-12-03 14:33

    Scipy is also available now via a homebrew tap. If you have homebrew installed:

    brew tap samueljohn/python
    brew install scipy
    

    See more info here: homebrew-python

    0 讨论(0)
  • 2020-12-03 14:36

    I tryed everything: pip, macports,easy_install,... with Mac OS El Captain. The only thing that worked for me was brew:

    $ brew install scipy
    

    After that, it will ask you to follow the instructions bellow:

    $ brew link --overwrite numpy
    $ mkdir -p /Users/adrieljr/Library/Python/2.7/lib/python/site-packages
    $ echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> /Users/adrieljr/Library/Python/2.7/lib/python/site-packages/homebrew.pth
    
    0 讨论(0)
  • 2020-12-03 14:44

    Here is what worked for me for pip installing matplotlib and scipy inside a virtual environment (Mac OS X 10.9.2 Mavericks):

    # See George's answer above
    brew update
    brew upgrade
    brew install gfortran 
    
    # See http://www.scipy.org/scipylib/building/macosx.html (the link Nathan Gould posted above)
    export CXX=g++-5.1
    export CC=gcc-5.1
    export FFLAGS=-ff2c
    sudo ln -s /usr/bin/gcc /usr/bin/gcc-5.1
    sudo ln -s /usr/bin/g++ /usr/bin/g++-5.1
    
    pip install matplotlib
    pip install scipy
    

    matplot lib installed quickly, but scipy took a long time.

    0 讨论(0)
  • 2020-12-03 14:46

    I recently also had trouble getting scipy to install on a virtualenv. My problem was that gfortran was not seen properly. I used macports sudo port install gcc48 and created a symlink to just gfortran by:

    sudo ln -s /opt/local/bin/gfortran-mp-4.8 /opt/local/bin/gfortran
    

    After that, pip install scipy worked without any errors on my virtualenv.

    0 讨论(0)
  • 2020-12-03 14:50

    I had similar issues installing scipy on OSX 10.9 Mavericks as well. What solved it for me is the following:

    sudo pip list
    

    was showing numpy, thus I did:

    sudo pip install --upgrade numpy
    

    Afterwards

    brew list
    

    was showing gfortran. I made sure I had the latest version by

    brew update
    brew upgrade
    

    but

    sudo pip install scipy 
    

    was failing with a weird fortran error. Thus I uninstalled it and reinstalled it

    sudo brew install gfortran
    sudo brew uninstall gfortran
    

    and to my great surprise

    sudo pip install scipy 
    

    worked after that.

    0 讨论(0)
  • 2020-12-03 14:51

    Pip has difficulties with scipy on OS X in general. It is not trivial to install from the sources, so I advise against it. In OS X you have a few better options:

    • Scipy superpack, a bunch of precompiled binaries
    • Enthought Canopy (free or another) has already everything you'll need (numpy, scipy, matplotlib, etc.)
    • Anaconda, a free scientific python distribution with probably all the packages you'll ever need.
    • MacPorts, a comprehensive and flexible package manager that allows you to install and maintain a python distribution
    • Homebrew, another popular package manager for OS X
    0 讨论(0)
提交回复
热议问题