Python matplotlib Module Installation full Solution __python

Source: Internet
Author: User

Because is learning computer vision processing, so need to install Matplotlib module, but in the process of installation difficulties, only to do today, only to be fully understand. Writing this blog post is mainly to help the latter and the need for future unprepared.


1, install matplotlib

Matplotlib's official address is http://matplotlib.org/.

Download the address for http://matplotlib.org/downloads.html, select the corresponding version can be installed,

The version I selected is Matplotlib-1.3.1.win32-py2.7.exe and is then installed directly.

At this time when import Pylab, and prompted no module six,

The error is as follows:

After that, you install six.


2, install six

Download Address http://www.lfd.uci.edu/~gohlke/pythonlibs/#six

Download is SIX-1.10.0-PY2.PY3-NONE-ANY.WHL, the suffix format WHL to zip, and then extract into your Python folder can be, a more concise way is to extract your python\lib\ file plus.

Then import again matplotlib or missing library: Dateutil

3, install Dateutil

Website Download: https://pypi.python.org/pypi/python-dateutil/1.4.1

I downloaded the python-dateutil-2.3 source installation also to the decompression directory, the implementation of Python setup.py install can also be installed successfully,

Continue execution: import matplotlib; still error: Missing pyparsing library

4, install pyparsing

Download Address http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing.

Be sure to download according to your version.

Still import matplotlib, or missing: NumPy:

    


5, install NumPy

Download http://www.numpy.org/

I directly downloaded the NumPy 1.9.1, the old way to install, the results in the installation, the error:

In response to this problem on the Internet, there are a lot of downloads installed MW What things, I tried, unintelligible. Looking for half a day to see, found is their own c++/c compiler VC settings problem, that is Python2.7 default VS2008, and we are now at least VS2010 or VS2012. Set up the issue.

First go to the Python directory and find the lib\distutils\msvc9compiler.py file:

Need to modify:

Put the following sentence in line No. 243:

Toolskey = "Vs%0.f0comntools"% version

Change into:

Toolskey = "Vs100comntools" #安装的是VS2010

Toolskey = "Vs110comntools" #安装的是VS2012

Toolskey = "Vs120comntools" #安装的是VS2013

In this line, if you install VS2012, change version directly to 11.0

If it's VS2013, change to 12.0.

After that, find out about line No. 661 and put the following:

Mfinfo = Self.manifest_get_embed_info (Target_desc, Ld_args)

To

Mfinfo = None

Execute the Python setup.py install installation numpy successfully:

Perform the import matplotlib again


Python Module Collection http://www.lfd.uci.edu/~gohlke/pythonlibs/

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.