problem with matplotlib package
已回答
In the past everything was working fine. However recently I can't run matplotlib
when I try import matplotlib.pyplot as plt
I get this error
import matplotlib.pyplot
ImportError: No module named pyplot
In Idle everything works fine. I also checked under the preference pan which interpreter I use. It is the same as for the idle.
Moreover matplotlib is listed under packages listes in pycharm and it is the latest version of marplotlib.
Any help or feedback here will be appreciated
请先登录再写评论。
Hi Jakub! Do you have custom modules/packages in your project named matplotlib? There maybe name collision, by default PyCharm adds some thing to PYTHONPATH, e.g. Content and Source roots, and it can lead to confusion - wrong matplotlib is going to be imported. Try to add
in your script and check the output.
Thanks Pavel for your feedback. It was enlightening - indeed I had a name collision in naming on of the files - it got imported instead. Fantastic now everything works as should.
Thanks for your quick response. Best