Indranil Ghosh Indranil Ghosh - 2 months ago 20
Python Question

Trying to install mathplot.lib for python 2.7.11. But Cannot find a suitable process. Have tried various ways from Youtube Tutorials, but invain

I have installed matplotlib-1.5.0.win-amd64-py2.7 from sourcefourge.net after downloading and installing numpy using commandprompt by using pip: pip install numpy. But when I write the following code it Gives me error. Help me out.
Code:

from matplotlib.pylab import *
pylab.plot([1,2,3,4],[1,2,3,4])
pylab.show()


It gives me following error message:

Traceback (most recent call last):
File "C:\Python27\Lib\idlelib\1.py", line 1, in <module>
from matplotlib.pylab import *
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 124, in <module>
from matplotlib.rcsetup import (defaultParams,
File "C:\Python27\lib\site-packages\matplotlib\rcsetup.py", line 25, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "C:\Python27\lib\site-packages\matplotlib\fontconfig_pattern.py", line 25, in <module>
from pyparsing import Literal, ZeroOrMore, \
ImportError: No module named pyparsing

Answer

refer to this answer of mine http://stackoverflow.com/a/38618044/5334188

install numpy

pip install numpy

If you face installation issues for numpy, get the pre-built windows installers from http://www.lfd.uci.edu/~gohlke/pythonlibs/ for your python version (python version is different from windows version).

numpy 32-bit: numpy-1.11.1+mkl-cp27-cp27m-win32.whl

numpy 64-bit: numpy-1.11.1+mkl-cp27-cp27m-win_amd64.whl

Later you require VC++ 9.0, then please get it from below link Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

Then install matplotlib using

pip install matplotlib

If you face errors, please download below from http://www.lfd.uci.edu/~gohlke/pythonlibs/, which will do the rest.

32-bit: matplotlib-1.5.3-cp27-cp27m-win32.whl

64-bit: matplotlib-1.5.3-cp27-cp27m-win_amd64.whl

works like charm

Comments