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

前端 未结 9 1672
天涯浪人
天涯浪人 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:52

    Installing scipy on Mac OS X with pip is possible! You will need the right C and Fortran compilers on your system to set up scipy. This page should help you:

    http://www.scipy.org/scipylib/building/macosx.html

    Once you have done that, you should be able to install with pip install scipy.

    As an additional troubleshooting note, you might need to create a symlink to your compiler so that the setup process can find it. A previous poster @biophetik gave an example of how to do this.

    Also, I already had numpy installed in my virtual environment when I installed scipy. I'm not positive whether/how one depends on the other.

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

    Just to add to what @Anton I. Sipos said. I had the Enthought package installed but had issues with upgrading it, so I decided to go with a clean install using Homebrew. Unfortunately just performing the tap and install didn't work well for me. So on searching a bit I found an issue on GitHub that samualjohn addressed and worked for me:

    brew remove python
    rm -rf /Library/Python/2.7/site-packages # it's save to delete this!
    brew install python
    pip install nose
    brew install numpy
    brew install scipy
    

    The problem was clearly conflicts in the site-packages that the Enthought uninstall instructions did not cover.

    NOTE: I had to install matplotlib with pip.

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

    On Mavericks the following works (might also work on other versions):

    If you haven't already, install pip

    sudo easy_install pip
    

    Then install/update scipy

    sudo pip install scipy -U
    

    For some reason pip installs scipy to

    /Library/Python/2.7/site-packages/
    

    and does not remove the older version in

    /System/Library/Frameworks/Python.framework/Versions/2.7//Extras/lib/python/scipy/
    

    So just remove the old version and it works. Print the version number:

    python -c "import scipy; print scipy.__version__"
    
    0 讨论(0)
提交回复
热议问题