Installing NumPy and SciPy on 64-bit Windows (with Pip)

Question:

I found out that it’s impossible to install NumPy/SciPy via installers on Windows 64-bit, that’s only possible on 32-bit. Because I need more memory than a 32-bit installation gives me, I need the 64-bit version of everything.

I tried to install everything via Pip and most things worked. But when I came to SciPy, it complained about missing a Fortran compiler. So I installed Fortran via MinGW/MSYS. But you can’t install SciPy right away after that, you need to reinstall NumPy. So I tried that, but now it doesn’t work anymore via Pip nor via easy_install. Both give these errors:

  • There are a lot of errors about LNK2019 and LNK1120,.
  • I get a lot of errors in the range of C: C2065,C2054,C2085,C2143`, etc. They belong together I believe.
  • There is no Fortran linker found, but I have no idea how to install that, can’t find anything on it.
  • And many more errors which are already out of the visible part of my cmd-windows…
  • The fatal error is about LNK1120:

    buildlib.win-amd64-2.7numpylinalglapack_lite.pyd : fatal error LNK1120: 7 unresolved externals
    error: Setup script exited with error: Command “C:UsersmeAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0VCBinamd64link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:BLAS /LIBPATH:C:Python27libs /LIBPATH:C:Python27PCbuildamd64 /LIBPATH:buildtemp.win-amd64-2.7 lapack.lib blas.lib /EXPORT:initlapack_lite buildtemp.win-amd64-2.7Releasenumpylinalglapack_litemodule.obj /OUT:buildlib.win-amd64-2.7numpylinalglapack_lite.pyd /IMPLIB:buildtemp.win-amd64-2.7Releasenumpylinalglapack_lite.lib /MANIFESTFILE:buildtemp.win-amd64-2.7Releasenumpylinalglapack_lite.pyd.manifest” failed with exit status 1120

What is the correct way to install the 64-bit versions NumPy and SciPy on a 64-bit Windows machine? Did I miss anything? Do I need to specify something somewhere? There is no information for Windows on these problems that I can find, only for Linux or Mac OS X, but they don’t help me as I can’t use their commands.

Asked By: Renzeee

||

Answers:

EDIT: The Numpy project now provides pre-compiled packages in the wheel format (package format enabling compiled code as binary in packages), so the installation is now as easy as with other packages.


Numpy (as also some other packages like Scipy, Pandas etc.) includes lot’s of C-, Cython, and Fortran code that needs to be compiled properly, before you can use it. This is, btw, also the reason why these Python-packages provide such fast Linear Algebra.

To get precompiled packages for Windows, have a look at Gohlke’s Unofficial Windows Binaries or use a distribution like Winpython (just works) or Anaconda (more complex) which provide an entire preconfigured environment with lots of packages from the scientific python stack.

Answered By: sebix

Look into python wheels to solve your problem. The best part of python wheels is that they let you install C extensions with no compilers. I just installed numpy and scipy using pip in a clean python install and they both worked fine.

Answered By: Fnord

Installing with pip

You can install the numpy and scipy wheels on Windows with pip in one step if you use the appropriate link from Gohlke’s Unofficial Windows Binaries (mentioned by sebix) and run the Windows command prompt as Administrator. For example, in Python 3.5, you would simply use something like this:

# numpy-1.9.3+mkl for Python 3.5 on Win AMD64
pip3.5 install http://www.lfd.uci.edu/~gohlke/pythonlibs/xmshzit7/numpy-1.9.3+mkl-cp35-none-win_amd64.whl

# scipy-0.16.1 for Python 3.5 on Win AMD64
pip3.5 install http://www.lfd.uci.edu/~gohlke/pythonlibs/xmshzit7/scipy-0.16.1-cp35-none-win_amd64.whl
Answered By: Justin O Barber

Best solution for this is to download and install VCforPython2.7 from https://www.microsoft.com/en-us/download/details.aspx?id=44266

Then try pip install numpy

Answered By: be_good_do_good

You can download the needed packages from here and use pip install "Abc.whl" from the directory where you have downloaded the file.

Answered By: Koundinya

You can install scipy and numpy using their wheels.

First install wheel package if it’s already not there…

pip install wheel

Just select the package you want from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

Example: if you’re running python3.5 32 bit on Windows choose scipy-0.18.1-cp35-cp35m-win_amd64.whl then it will automatically download.

Then go to the command line and change the directory to the downloads folder and install the above wheel using pip.

Example:

cd C:Users[user]Downloads
pip install scipy-0.18.1-cp35-cp35m-win_amd64.whl

Intel provides pre-compiled Python modules for free in their “Intel Distribution for Python”. The modules are compiled against Intel’s MKL (Math Kernel Library) and thus optimized for faster performance. The package includes NumPy, SciPy, scikit-learn, pandas, matplotlib, Numba, tbb, pyDAAL, Jupyter, and others. Find more information and the download link here

Answered By: robertspierre

for python 3.6, the following worked for me
launch cmd.exe as administrator

pip install numpy-1.13.0+mkl-cp36-cp36m-win32
pip install scipy-0.19.1-cp36-cp36m-win32

Answered By: Gajendra D Ambi

If you are on windows , you wouldn’t need wheel anyway! You can directly install package by downloading the 32-bit package as win32 from this link [http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy] and then move that downloaded package to cmd’s current directory and open cmd and write following codepip install numpy-1.13.1+mkl-cp36-cp36m-win32.whl then do it same for scipy

For 64-bit you need to install mingw-w64 as it is gcc and compiles numpy and scipy as precompiled status.

Currently it works fine with 32-bit.So I had opted for win32 package both for numpy+mkl and scipy in that link.

Hope This works! Give a try

Answered By: Meet Zaveri

Package version are very important.

I found some stable combination that works on my Windows10 64 bit machine:

pip install numpy-1.12.0+mkl-cp36-cp36m-win64.whl
pip install scipy-0.18.1-cp36-cp36m-win64.whl
pip install matplotlib-2.0.0-cp36-cp36m-win64.whl

Source.

Hey I had the same issue.
You can find all the packages in the link below:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn
And choose the package you need for your version of windows and python.

You have to download the file with whl extension. After that, you will copy the file into your python directory then run the following command:
py -3.6 -m pip install matplotlib-2.1.0-cp36-cp36m-win_amd64.whl

Here is an example when I wanted to install matplolib for my python 3.6 https://www.youtube.com/watch?v=MzV4N4XUvYc
and this is the video I followed.

Downloading the binaries for 64-bit from http://www.lfd.uci.edu/~gohlke/pythonlibs/, and installing it directly with pip in this order:

pip install numpy-1.12.0+mkl-cp36-cp36m-win64.whl
pip install scipy-0.18.1-cp36-cp36m-win64.whl
pip install matplotlib-2.0.0-cp36-cp36m-win64.whl

Note that you must place command prompt in the folder where you put the .whl files after downloading them, and you must run it as administrator,
worked for me on Windows 10 64-bit now python is up and running.

You can now pip install numpy on Windows!

“Note: this page has only historical relevance, you can now pip-install for windows”
Source: https://github.com/numpy/numpy/wiki/Whats-with-Windows-builds

Answered By: PaulMest

Follow these steps:

  1. Open CMD as administrator
  2. Enter this command : cd..
  3. cd..
  4. cd Program FilesPython38Scripts
  5. Download the package you want and put it in Python38Scripts folder.
  6. pip install packagename.whl
  7. Done

You can write your python version instead of "38"

Answered By: Mehdi
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.