QNA
QNA

Reputation: 1087

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).

Upvotes: 29

Views: 383975

Answers (8)

Ivan Zadorozhniy
Ivan Zadorozhniy

Reputation: 5

I had the same problem.

I decided in a very unexpected way. I just opened the command line as an administrator. And then typed:

pip install numpy

Upvotes: -4

juzer tarwala
juzer tarwala

Reputation: 41

First go through page Download Python to download Python 3.6.1 or 2.7.13 either of your choice. I preferred to use Python 2.7 or 3.4.4.

Now after installation, go to the folder name python27 or python34, and click on the script. Now here open the command prompt by left clicking and Run as administrator.

After the command prompt appears, write "pip install numpy" there. This will install the latest version of NumPy and installing it will show a success comment. That's all.

Similarly, Matplotlib can be installed by just typing "pip install matplotlip". And now if you want to download SciPy, then just write "pip install scipy" and if it doesn't work then you need to download Python SciPy from SciPy: Scientific Library for Python and install it.

Upvotes: 0

leewz
leewz

Reputation: 3346

As of March 2016, pip install numpy works on Windows without a Fortran compiler. See here.

pip install scipy still tries to use a compiler.

July 2018: mojoken reports pip install scipy working on Windows without a Fortran compiler.

Upvotes: 16

Colonel Panic
Colonel Panic

Reputation: 137742

Frustratingly, the NumPy package published to PyPI won't install on most Windows computers: Windows wheel package (.whl) on Pypi #5479

Instead:

  1. Download the NumPy wheel for your Python version from Archived: Unofficial Windows Binaries for Python Extension Packages, NumPy

  2. Install it from the command line:

    pip install numpy-1.10.2+mkl-cp35-none-win_amd64.whl
    

Upvotes: 22

Akhilesh Shukla
Akhilesh Shukla

Reputation: 308

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).

Upvotes: 26

acs
acs

Reputation: 836

Check the installation of Python 2.7, and then install/reinstall pip which is described here. Then a open command line windows and write:

pip install numpy

Or

pip install scipy

If already installed, try this:

pip install -U numpy

Upvotes: 34

Vinorth
Vinorth

Reputation: 1033

py -m pip install numpy

Worked for me!

Upvotes: 9

Jonathas Groetares
Jonathas Groetares

Reputation: 1

Install miniconda (here)

After installed, open Anaconda Prompt (search this in Start Menu)

Write:

pip install numpy

After installed, test:

import numpy as np

Upvotes: 0

Related Questions