Search code examples
pythonpython-2.7visual-c++numpypip

How can I install NumPy on Windows using 'pip install'?


I want to install NumPy using the pip install numpy command, but I get the following error:

RuntimeError: Broken toolchain: cannot link a simple C program

I'm using Windows 7 32 bit, Python 2.7.9, pip 6.1.1 and some MSVC compiler. I think it uses the compiler from Visual C++ 2010 Express, but actually I'm not sure which one, because I have several Visual Studio installations.

I know that there are prebuilt packages for Windows, but is there some way to do it just by typing pip install numpy?

I think that there could be other packages which must be compiled before usage, so it's not only about NumPy. I want to solve the problem with my compiler, so I could easily install any other similar package without necessity to search for prebuilt packages (and hope that there are some at all).


Solution

  • Installing extension modules can be an issue with pip. This is why Conda exists. Conda is an open-source BSD-licensed cross-platform package manager. It can easily install NumPy.

    Two options:

    • Install Anaconda here
    • Install Miniconda here and then go to a command line and type conda install numpy (make sure your PATH includes the location Conda was installed to).