Python Library-Import matplotlib.pyplot as PLT error problem

Source: Internet
Author: User

1. Set Environment variables firstSet the following path in the PATH variable: c:\python27\scriptsc:\python27 2, because Matplotlib relies on dateutil and pyparsing, so need to install Dateutil, and we dateutil use the Easy_install command to install it, but the C:\Python27\Scripts directory does not have a default Easy_ Install.exe (below two address, download is the WHL file, need to use the PIP command to install, but did not try) http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutilhttp ://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing可以看到Matplotlib, a 2D plotting library. Requires NumPy, Dateutil, Pytz, pyparsing, Cycler, Setuptools, and optionally pillow, Pycairo, Tornado, Wxpython, Pyside, Pyqt4, Ghostscript, MiKTeX, FFmpeg, MEncoder, Avconv, or ImageMagick. So the packages above must all be needed, and if there is no problem, it may be that the packages are not referenced in the code, or they are already installed. 3, installation Easy_install.exeHttps://pypi.python.org/pypi/setuptools Find the ez_setup.py file, download it locally under the cmd window, type: Python E:\iso\VisualStudio2010\ez_ setup.py successful, the C:\Python27\Scripts\ directory will be more Easy_install.exe 4. Use Easy_install.exe to install Dateutil and pyparsing。。 Anyway, according to the hint, what is missing is installed with Easy_install What, this easy_install is to follow the keyword to search the installation package. Easy_install python-dateutileasy_install pyparsingeasy_install pip 4-2, do not use Easy-install installed, just use Easy_ Install PIP and then use PIP to install WHL such as dateutil,pyparsing,matplotlib,pandas,numpy,scipy. 5, the path such as: C:\Python27\Lib\site-packages\scipy\lib in the six.py six.pyc six.pyo three files copied to the C:\Python27\Lib\site-packages directory. In addition, these packages seem to be able to download the installation package files, but I did not try Https://pypi.python.org/pypi/python-dateutil/1.4.1http://www.pythonhosted.org/six/ Http://pyparsing.wikispaces.com/Download+and+Installation 6, using WHL to install a variety of packagesOn the following page to download the corresponding 32bit or 64bit, distinguish between python2.7 or Python3 http://www.lfd.uci.edu/~gohlke/pythonlibs/# Numpymatplotlib-1.5.2-cp27-cp27m-win_amd64numpy-1.11.1+mkl-cp27-cp27m-win_ Amd64.whlpandas-0.18.1-cp27-cp27m-win_amd64.whlscipy-0.17.1-cp27-cp27m-win_ AMD64.WHL put the above required WHL in the Python Scripts directory, and then use the following command to install the C:\PYTHON27-X64\SCRIPTS>PIP installed Pandas-0.18.1-cp27-cp27m-win_amd64.whl

Python Library-Import matplotlib.pyplot as PLT error problem

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.