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条回答
Emotional °昔
2楼-- · 2019-03-28 07:34

Matt's answer is correct; however, I would suggest the easiest thing to do is download a prebuilt Python distribution. I've used Winpython (http://winpython.sourceforge.net/) with good success, though there are certainly others (Enthought, Python(x,y)).

If you use Winpython, open its Control Panel, and register your distribution. If you download more packages off PyPI later, that control panel can install them for you, but it's fairly full featured as-distrubted.

查看更多
女痞
3楼-- · 2019-03-28 07:38

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
    
查看更多
一纸荒年 Trace。
4楼-- · 2019-03-28 07:45

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.

查看更多
相关推荐>>
5楼-- · 2019-03-28 07:47

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.

查看更多
ら.Afraid
6楼-- · 2019-03-28 07:49

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.

查看更多
仙女界的扛把子
7楼-- · 2019-03-28 07:55

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.

查看更多
登录 后发表回答