not able to import matplotlib

1,119 views
Skip to first unread message

Meghana Munj

unread,
Jan 17, 2017, 2:21:29 AM1/17/17
to thonny
hello u have installed the thonny. new to python. all other common statements worked. 

and then tried to install matplotlib. 
tried writing simple piece of code to draw a graph.

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()

it gives following error pls can someone help.

Traceback (most recent call last):
  File "C:\Users\munjm\Documents\python\p10.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Users\munjm\AppData\Local\Programs\Thonny\lib\site-packages\matplotlib\pyplot.py", line 29, in <module>
    import matplotlib.colorbar
  File "C:\Users\munjm\AppData\Local\Programs\Thonny\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
    import matplotlib.artist as martist
  File "C:\Users\munjm\AppData\Local\Programs\Thonny\lib\site-packages\matplotlib\artist.py", line 14, in <module>
    from .transforms import (Bbox, IdentityTransform, TransformedBbox,
  File "C:\Users\munjm\AppData\Local\Programs\Thonny\lib\site-packages\matplotlib\transforms.py", line 39, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: DLL load failed: The specified module could not be found.

Aivar Annamaa

unread,
Jan 17, 2017, 2:32:44 AM1/17/17
to thonny
Hi!

How did you install matplotlib?
(When I do "Tools" => "Open system shell" => "pip install matplotlib", then your script runs fine)

Aivar
Reply all
Reply to author
Forward
0 new messages