I have a virtual environment set up (Pyvenv, Python 3.4), but after executing activate.bat and the command pip install numpy
, i get an error stating "Unable to find vcvarsall.bat".
I added C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
to the PATH variable, which contains the vcvarsall.bat file, yet the error still remains. What is the issue here?
You do not need to compile numpy on Windows, you can just download the binaries. The numpy team does not upload Windows binaries to pypi (an open github issue on the subject can be found here), and you will need to download them manually from an alternative site. This is quite easy:
activate
your env and check if you have a 32 or 64 bit Python:
(myenv) c:\mypoject\> python -c "import platform; print(platform.architecture()[0])"
This should print 32bit
or 64bit
.
Download the correct numpy from here and save it somewhere, (i.e. c:\downloads
).
For 64bit
download the win-amd-64
versions, and for 32bit
use the win32
versions.
For example, for my python 2.7, I would need to download numpy-1.10.2+mkl-cp27-none-win32.whl
. Make sure you don't change the file name! .whl
files needs some information from the file name to be correctly identified by the pip installer!
Having your env still activated, just use pip
(which supports installing from whl
files) to extract and install numpy:
(myenv) c:\mypoject\> pip install c:\downloads\numpy-1.10.2+mkl-cp27-none-win32.whl
That's it!
Update: edited to use pip + .whl
instead of obsolete easy_install + .exe
packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With