Python manual Installation Method (including Matplotlib library) __python

Source: Internet
Author: User
Reproduced from: http://blog.sciencenet.cn/blog-579770-738240.html

In fact, the Python installation is very simple, download the installation software, all the way yes, OK on it. But to install other modules or packages, it is more cumbersome, to download one by one, typically Linux mode. The easy way is to use the EPD release, it contains a lot of scientific calculations and so on, should be enough.

The following describes the installation of Matplotlib, enough trouble:


Matplotlib installed under Windows Some complex, toss for a long time, finally finished, the following my installation tutorials to share.

Previous steps reproduced from: Daniel's technical notes http://blog.csdn.net/daniel_ustc/article/details/9714163

Matplotlib installation can see the website link http://matplotlib.org/users/installing.html

The following summary steps are as follows:

The Windows platform downloads the. exe format for installation directly.

1,python download installation download address.

2, install the matplotlib you need (this is based on the Python version of step 1) and download the address.

Install the Matplotlib dependent libraries below

3, for the standard version of Python, to use matplotlib, you also need to install the NumPy module, its download address.

4, Msvcp71.dll, on some systems, you may also need to download the Msvcp71.dll library. Download

This file, after decompression, drag it to the C:\Windows\System32 directory.

5, run a simple program example:

[python] view plaincopy

1. Import Matplotlib.pyplot as Plt

2. Plt.plot ([1,2,3])

3. Plt.ylabel (' some numbers ')

4. Plt.show ()

The following error was found:

Raise Importerror ("Matplotlib requiresdateutil")
Importerror:matplotlib requires Dateutil

This needs dateutil, you can download the installation here.

The following error occurred after installing the Dateutil:

Raise Importerror ("Matplotlib requirespyparsing")
Importerror:matplotlib requires pyparsing

Need to pyparsing here to download the installation.

The following error occurred after installing pyparsing:

No Module name Six

Go to PyPI and download six-1.4.1.tar.gz.

This installation is simple, just unzip it to the Python installation directory OK, my is C:\Python33

Test the following in Ipython



If you encounter some dependent packages that need to be installed during program installation, you can find them here, which is really a good resource.

According to the needs of the drawing in the following link to select the appropriate graphics to modify, to draw their own images needed.

Example:http://matplotlib.org/examples/index.html, gallery:http://matplotlib.org/gallery.html

Note the solution to the Chinese language when drawing, adding the following on the head of the. py file:

#-*-Coding:utf-8-*-

from Pylab Import *

mpl.rcparams[' font.sans-serif '] = [' Simhei '] #指定默认字体

mpl.rcparams[' axes.unicode_minus ' = False #解决保存图像是负号 '-' the problem that appears as a box



This article references address: http://blog.sciencenet.cn/blog-579770-738240.htm


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.