I am using MinGW on a 64-bit Windows machine. I am using Python 2.6.8. When I try to install numpy from http://sourceforge.net/projects/numpy/files/NumPy/ , the error comes up that it cannot find Python2.6 in the registry. Please walk me through what I should do.
1 Answers
Do you have pip
installed? That would generally be the best way to install it.
With pip
If you don't have pip
, do the following:
- Run
curl http://python-distribute.org/distribute_setup.py | python
. This provides you with tools you'll need to install the package manager. - Run
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
. This installs the package manager.
Then run pip install numpy
, and it should install for you.
If that doesn't work
Sometimes on Windows machines, installing more complex Python packages throws errors like Unable to find vcvarsall.bat
or gcc exited with status code 1
or something along those lines, which are compilation errors. You can get around that by installing unofficial pre-compiled binaries, by running
easy_install http://www.lfd.uci.edu/~gohlke/pythonlibs/2kgjgnai/numpy-MKL-1.6.2.win-amd64-py2.6.exe
That installs a pre-compiled optimized binary of Numpy. This isn't as perfect as installing it straight from the index, and sometimes there can be minor incompatibilities, but it should be fine for most purposes.
After this is completed, you should be able to import numpy
without issue.
-
In trying your "With pip" option, I cannot do step 1 because I get the following: "error: can't create or remove files in install directory. [Errno 2] No such file or directory: 'Lib\\site-packages\\test-easy-install-27172.write-test' Lib\site-packages\ does not currently exist". It suggests changing the install directory via flag --install-dir, but curl does not have such an option (curl --help). Should I just create this directory, and if so, where? I cannot use your second option because I don't have easy_install (I think). – user1748601 Oct 16 '12 at 17:31
-
@user1748601 I didn't put the full set of instructions for getting `easy_install` and `pip` because it seemed out of the scope of the question, but try with [this method](http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows/9038397#9038397) or [this one](http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows), and once you get `pip` and `easy_install` installed (which you should have anyway) you should be good to go. – jdotjdot Oct 16 '12 at 20:36
-
Thanks, I had several other problems, so I ended up just reinstalling Python and using an unofficial 64-bit version of numpy ("pip install numpy" didn't work b/c of 32/64-bit issues). – user1748601 Oct 17 '12 at 02:43