Please don't use this method any more, this is ages old (2014, Python 2.7).
Assuming you use virtualenv
for Python library hygiene. Now you want Numpy and Scipy in your project.
NumPy and SciPy can not be easily installed under Mac OS X with a simple
pip install scipy
due to heavy dependencies.
However, homebrew-python provides them as recipes. Therefore you can
- install
numpy
andscipy
fromhomebrew-python
- symlink them into a virtualenv
Try it:
brew install homebrew/python/scipy
python -m virtualenv venv-playground
ln -s /usr/local/lib/python2.7/site-packages/{numpy,scipy}* venv-playground/lib/python2.7/site-packages/
source venv-playground/bin/activate
pip freeze
You should see something like this:
numpy==1.9.0
scipy==0.14.0
wsgiref==0.1.2
So I installed scipy using MacPorts, and linked it to lib/python3.10/site-packages, which is where the virtualenv installed by MacPorts installs packages (I installed numpy using pip to test). Then I activated the virtual environment and did
pip freeze
. It only showsnumpy==1.22.2
but not scipy. Is there an additional step needed to let pip know that scipy is available? It keeps trying to rebuild it when installing other packages!