Installing numpy, matplotlib on windows 7 64 bit

2019-03-28 07:17发布

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!

7条回答
我想做一个坏孩纸
2楼-- · 2019-03-28 07:58

Same issue here and had to fix multiple times. The best solution I found, keeping your current installation of Python, was...

(1) If you don't already have PIP installed, install with instructions on https://pip.pypa.io/en/latest/installing.html (referenced on python.org site).

(2) Install numpy with unofficial binaries here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy.

update: This link was updated to include PIP "wheel" files (.whl) instead of Windows installation files. Once you download the appropriate wheel (say, file.whl), you install it like this:

pip install "location_of_whl_file\file.whl"

(pointing to the location of the wheel file)

(3) Then install matplotlib with PIP via command pip install matplotlib This will install all dependencies correctly (other than numpy which required the manual installation).

查看更多
登录 后发表回答