0

Dear all

I have downloaded matplot lib for python2.7.2 windows using[(http://matplotlib.org/downloads.html)]Click Here . As per example i tried coding i found pyplot is not highlighted.i have attached test.cv file for which graph has to be plotted

   import csv
        import matplotlib.pyplot as plt
        plt.figure()

        def main():
            pass


        if __name__ == '__main__':
            main()
            file =open("test.csv","r+")
            TIME=[]
            ACT_ANGLE=[]
            DES_ANGLE=[]
            for line in reader:
               TIME.append(line[1])
               print TIME
               ACT_ANGLE.append(line[2])
               DES_ANGLE.append(line[3])

            x=TIME
            z=ACT_ANGLE
            #print x
            y=DES_ANGLE


            plt.plot(x,y)
            plt.xlabel('Time in Sec')
            plt.show()
            plt.savefig("example.png")

error report given below

Traceback (most recent call last):
  File "C:\Documents and Settings\Administrator\My Documents\python code\m2.py", line 2, in <module>

  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 125, in <module>
    raise ImportError("matplotlib requires pyparsing")
ImportError: matplotlib requires pyparsing
2
Contributors
14
Replies
87
Views
3 Years
Discussion Span
Last Post by Gribouillis
0

i tried but it didn't worked. Let me know why it doesnot highlight pyplot eventhrough matplot is installed. even i given path from tools

0

I tried to reproduce the bug in windows XP with python 32 bits installed. I had to install python-dateutil module from Christoph Gohlke's site, then pyparsing as I said in the previous post, but the installer refused to run because I didn't have msvcr71.dll. I got the dll here (download the zip file uncompress and move the dll to the System folder). Once pyparsing was installed, I needed numpy (1.8.0 superpack from sourceforge) and finally the package Six from Gohlke's site. Then the following line succeeded

from matplotlib import pyplot as plt

My advice: install linux mint in a virtualbox and say good bye to issues in python modules installs !

Edited by Gribouillis

0

If it's still the same error message, it means that your python cannot find the pyparsing module and you must find out why. Try

>>> import pyparsing

in your interpreter. Also try to locate pyparsing.py on your computer.

0

in my interpreter also it is not detecting ,,, giving error as below.best way to plot graph using python

import matplotlib.pypasring as plt
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 125, in <module>
    raise ImportError("matplotlib requires pyparsing")
ImportError: matplotlib requires pyparsing
0

yes i installed it . i am sharing some snap shot you can check.

Else let me know links where i can instal newley and make it work.

Edited by ajit.nayak: doc not attached

0

Where is pyparsing.py on your computer ?
What does python say when you type import pyparsing ?

Edited by Gribouillis

0

error report

>Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 125, in <module>
    raise ImportError("matplotlib requires pyparsing")
ImportError: matplotlib requires pyparsing
0

import pyparsing

it will not give any error

 from matplotlib import pyparsing
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 129, in <module>
    "matplotlib requires pyparsing >= 1.5.6")
ImportError: matplotlib requires pyparsing >= 1.5.6
0

There is a developpers discussion here. You may have an old install of matplotlib still on your disk. You may need to remove the folder C:\Python27\lib\site-packages\matplotlib if it exists, as suggested in this thread, and perhaps reinstall matplotlib.

Edited by Gribouillis

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.