Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Numpy in VirtualEnv on Windows

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

like image 325
StackUnderflow Avatar asked Jun 16 '10 05:06

StackUnderflow


2 Answers

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.

like image 121
mlissner Avatar answered Oct 17 '22 00:10

mlissner


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.

like image 43
David Cournapeau Avatar answered Oct 16 '22 22:10

David Cournapeau