Install python in 64-bit Windows 7 and configure the numpy and matplotlib libraries and numpymatplotlib

Source: Internet
Author: User
Tags install matplotlib

Install python in 64-bit Windows 7 and configure the numpy and matplotlib libraries and numpymatplotlib

I,PythonInstallation

1. Download python2.7 ,:Http://www.python.org/Select the system version. I chose python2.7.6.

  • Python-2.7.6rc1.amd64.msi

2. Click Install directly. you can install it in the python27 file under the d directory (this is your installation path, or you can select the installation path ).

3. Set the environment variables. In the "my computer" attribute, choose Advanced Settings> environment variable Settings> path, and add "; D: \ python27.

 

II,NumpyInstallation

In the win64 python2.7 environmentCmdWhen you use the "pip install numpy" command to install numpy, the system prompts "not an internal or external command.

There are two reasons:

  • No pip environment path set
  • Pip Not Installed

The complete installation steps are as follows:

1. Install pip

After installing the Python2.7 installation package, the scripts folder will not be generated many times in the Python2.7 installation directory (at least I re-installed it n times, which is unacceptable), resulting in no

Use pip.

It may be because of a problem with my installation package. We suggest you change the installation package first. If the problem persists after the installation package is changed, let's take a look at how I solved the problem, for reference only.

  • Go to the official website to downloadEz_setup.pyFile.
  • Go to the path where the ez_setup.py file is located in cmd and run the "Python ez_setup.py" command. After the command is complete, the scripts folder is generated.
  • Switch to the scriptsfolder, install pips, and enter the command "easy_install.exe pip ".
  • Then configure the environment variables. Add to path... \ Python27 \ ScriptsThis path.

2. Download numpy

InHttp://www.lfd.uci.edu /~ Gohlke/pythonlibs/# numpy Select the corresponding system version to download:

  • Numpy route 1.13.1 + mkl route cp27 route cp27m route win_amd64.whl

Because the file suffix is ". whl", you cannot directly double-click to install it. Therefore, we need to install wheel first.

3. Install wheel

Enter the "pip install wheel" command in cmd to complete the installation.

4. Install numpy

C: \ Users \ Administrator> pip install D: \ python27 \ numpy-1.9.2 + mkl-cp27-none-win_amd64.whl

If an error occurs during installation:

"UnicodeDecodeError: 'ascii 'codec can't decode byte 0xc4 in position 33: ordinal not in range (128 )"

Refer to"Solve Python UnicodeDecodeError".

5. verify whether the installation is successful

>>> From numpy import *

If no error is reported, the installation is successful.

 

III,MatplotlibInstallation

1. Download matplotlib fromHttp://www.lfd.uci.edu /~ Gohlke/pythonlibs/# matplotlibDownload the corresponding version.

  • Matplotlib-1.5.3-cp27-cp27m-win_amd64.whl

2. Install matplotlib

C: \ Users \ Administrator> pip install D: \ python27 \ matplotlib-1.5.3-cp27-cp27m-win_amd64.whl

3. verify whether the installation is successful

 

1 from pylab import *2 3 n = 84 X,Y = np.mgrid[0:n,0:n]5 quiver(X,Y), show()

 

The execution result is as follows:

 

By now, all installation is complete.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.