Rakesh12
Rakesh12

Reputation: 409

unable to import Matplotlib python 2.7 windows 7

I am Unable to import matplotlib

I am able to import it through command prompt(python interpreter) But when i use it in a program with just one line import matplotlib as plt I am getting theese errors

Traceback (most recent call last):
  File "D:\python\gis\test.py", line 1, in <module>
    import matplotlib as plt
  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 133, in <module>
    from matplotlib.rcsetup import (defaultParams,
  File "C:\Python27\lib\site-packages\matplotlib\rcsetup.py", line 19, in <module>
    from matplotlib.colors import is_color_like
  File "C:\Python27\lib\site-packages\matplotlib\colors.py", line 54, in <module>
    import matplotlib.cbook as cbook
  File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 15, in <module>
    import new
  File "D:\python\gis\new.py", line 27, in <module>
    nx.draw(G, pos=pos)
  File "C:\Python27\lib\site-packages\networkx-1.7.dev_20120522142611-py2.7.egg\networkx\drawing\nx_pylab.py", line 114, in draw
    raise ImportError("Matplotlib required for draw()")
ImportError: Matplotlib required for draw()

I have checked the path it contains only C:/python27 only not other python directories Guys please help me out

Upvotes: 0

Views: 1484

Answers (1)

cgohlke
cgohlke

Reputation: 9437

The D:\python\gis\new.py module is shadowing the Python standard library new module. Try rename your new module.

Upvotes: 2

Related Questions