How update numpy 1.11 on Windows

24,794

Solution 1

Pip is the easiest way to go installing packages. Your first problem appears to be that windows isn't recognising python as a command. In order to fix this you need to add it to the PATH environment variable.

  1. Open Start Menu and right click My Computer. Click on Advanced System Settings.
  2. Click on Environment Variables
  3. Find the PATH variable and click Edit. You want to add Python to this PATH variable by adding exactly ;C:\Python27

According to the documentation your version of Python, 2.7.9, should come with pip installed so no need for you to do anything there.

Open the command prompt and type pip install --upgrade numpy and it should upgrade to the newest version.

Solution 2

Both numpy and scipy have problems installing from pypi (the default repository of pip) on windows. The way I always install it it to download the .whl files from Christoper Gohlke's site and install them with pip.

For example, if you are running Python 3.5 on a 64 bit machine:

  • Start by downloading numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl from the site linked above
  • After the download is finished, open a powershell window and cd to your python scripts directory (mine is C:\\Python35\Scripts).
  • From there you can use pip to install the whl file with pip install C:\Users\USERNAME\Downloads\numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl
Share:
24,794
Cass
Author by

Cass

Presentation Bi Consultant in France I worked about analyse/acquisition data in the domain of energy. (Work on Python 2.7 actually) I worked on database for the Retail.(SQL/PLSQL/ATACCAMA) #

Updated on July 09, 2022

Comments

  • Cass
    Cass almost 2 years

    First of all I know this subject is duplicate, but if I understood the problem, I wouldn't come here to ask my question.

    I read
    Explain why numpy should not be imported from source directory and probably 2^6 other sites/questions/solution (pip etc..) with similar issues, but I still don't understand. I'm a beginner, I have no problem when I update library of python on ubuntu, but on windows, I've lost my nerves.

    So I will explain the way I update my library :

    I go on https://github.com/numpy/numpy/releases

    I take the v.1.11.0 (the zip)

    I get the file numpy-1.11.0.zip in downloads

    I delete the file 'numpy' in C:\Python27\Lib\site-packages

    I put my new file numpy-1.11.0.zip in site-packages

    I unzip that file.

    I click on all of the .py of that upzip file

    When I try to compile my code (which work on previous version of numpy), I get an error:

    ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there.

    Where did I fail to update my numpy library? Could someone explain to me in a simple way, because I'm really a noob.

  • Cass
    Cass almost 8 years
    Thanks a lot for the detailled explication of your steps ! I will keep your solution too.