6

How can I install numpy in virtualenv...

easy_install numpy is throwing error.. I can not use the binary installer because this would install numpy in the python main installation and not in virtualenv..

Thanks

StackUnderflow
  • 24,080
  • 14
  • 54
  • 77
  • see http://stackoverflow.com/questions/6114115/windows-virtualenv-pip-numpy-problems-when-installing-numpy?rq=1 – Josef Oct 14 '12 at 23:24

2 Answers2

2

Another (not so great) solution is to get the installer, install it into your default Python directory, then copy it over to your virtualenv manually.

Long version

  1. Go here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
  2. Install it.
  3. Find it in your python installation (probably at C:\Python27\Lib\site_packages\numpy, or similar
  4. Copy the numpy directory over to $virtual_env\Lib\sites_packages\numpy.

Worked for me, but it's not elegant. I think there are also exe installers on numpy's site, but I find it's easier to just go to the one above when I need things than to poke around on various other sites.

mlissner
  • 17,359
  • 18
  • 106
  • 169
  • 1
    Worked. not elegent though... pip does not see the numpy install so it is not listed in the pip freeze – Joop Jun 13 '13 at 14:43
1

You cannot use easy_install directly for fairly technical reasons I would rather not get into. There is a solution, albeit not optimal: once in the virtual environment, go into numpy sources, and run:

python setupegg.py install

The key point is using setupegg.py instead of setup.py.

David Cournapeau
  • 78,318
  • 8
  • 63
  • 70