Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing numpy, matplotlib on windows 7 64 bit

The version of Python I have working on my computer is Python2.7 (32 bit) even though I have Windows 7 64-bit (Python works fine, no problem there)

--> I downloaded - numpy 1.8.0 from https://pypi.python.org/pypi/numpy but I don't know how to proceed with installation.

--> I tried downloading from here - http://www.lfd.uci.edu/~gohlke/pythonlibs/ (tried with both 32-bit and amd64-bit versions) . However, I kept getting the following error - Python27 not found in the registry.

--> After moving "Python27" from some other location to C:\Python27, the installation ran properly. I'm now trying

import numpy

but I get an error saying module does not exist

Could anyone please guide on how to get this working, as well as installing matplotlib ? If there is a link, please link me to it.

edit - while I was waiting for answers on here (happy to see the replies! I did some tinkering and I've managed to install all the above. I'm attaching a screenshot of the procedures I followed. But while running a test script for MatPlotLib to plot a graph, instead of a figure of the graph, I'm getting this message - [ < matplotlib.lines.Line2D object at 0x05A29650 > ] If someone could help me out , I'd be grateful and if Thank You doesn't suffice, I'll pay you back in Bitcoin ($1 worth)!

steps of installation

edit 2 - Ah, I saved the plot into a variable and then ran pylab.show(variable). Works. Thanks for all the replies!

like image 638
Raaj Avatar asked Jan 22 '14 01:01

Raaj


5 Answers

It is also worth considering the Anaconda Python distribution.

http://continuum.io/downloads

It bundles many packages, including NumPy and Matplotlib. I use it on Windows and it is easy to install and to maintain. The one downside, as of this writing, is that they haven't uploaded a Windows build of NumPy 1.8. If you need some feature specific to NumPy 1.8, you can use the installer from the website you mentioned, i.e.

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Update: 1.8 has been there for some time now. They are very good about keeping all the packages up to date, but, if you really need something that isn't already there, check the installers on Gohlke's website.

like image 96
IanH Avatar answered Nov 07 '22 11:11

IanH


Go to your Python directory, scripts folder:

cd c:\python27\scripts>

Enter the following command on command prompt:

c:\python27\scripts>pip install numpy

Internet connection is required during installation.

like image 33
John Tarus Avatar answered Nov 07 '22 13:11

John Tarus


Firstly uninstall Python.

Then there are two easy choices:

Either:

Try a Python distribution bundled with the necessary libraries. I've used the Enthought Python Distribution before which has been renamed to Canopy Express.

Or:

Install Python 2.7 64bit, all the 64 bit libraries you need from http://www.lfd.uci.edu/~gohlke/pythonlibs/ come with an installer.

To get matplotlib running you'll need to download numpy, dateutil, pyparsing, pillow and you many want a different backend for rendering such as wxPython. Check you're downloading the correct versions, they'll end with something like '.win-amd64-py2.7.exe'. Don't worry if you have an Intel processor, it will still work.

like image 25
Brownstone Avatar answered Nov 07 '22 11:11

Brownstone


Numpy:

  1. Download and install Microsoft Visual C++ Compiler for Python 2.7
  2. Download and extract numpy-1.10.1.zip
  3. Open cmd.exe and cd to numpy-1.10.1 root

    python setup.py install
    
like image 45
BMW Avatar answered Nov 07 '22 13:11

BMW


Probably the easiest thing to do is reinstall Python from python.org, either 32- or 64-bit, make sure that runs smoothly, and then try to reinstall NumPy, matplotlib, and matplotlib's dependencies (dateutil, pytz, pyparsing, six, pillow, and a backend like pyqt4 or pycairo if you don't want to use the default Tk backend), all from Gohlke's site. Make sure you get the "bitness" for the version of Python you install (you shouldn't mix 32-bit modules with a 64-bit base system, and vice versa), and get the -py27 versions. After that everything should be working fine.

like image 29
MattDMo Avatar answered Nov 07 '22 12:11

MattDMo