StackUnderflow
StackUnderflow

Reputation: 25378

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

Upvotes: 6

Views: 3356

Answers (2)

mlissner
mlissner

Reputation: 18186

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.

Upvotes: 2

David Cournapeau
David Cournapeau

Reputation: 80770

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.

Upvotes: 1

Related Questions