matplotlib - Python: "ModuleNotFoundError", but module is installed? -
i realize seems generic question, answers pointed having 2 simultanious python installations - uninstalled other one.
currently run code pycharm 2017.1.5 (windows 10) python interpreter set python 3.6.1 (c:\anaconda3\python.exe), i.e. installed anaconda3, includes matplotlib, , run pycharm using ananconda3-interpreter.
i've checked in anaconda navigator matplotlib 2.0.2 installed in environment.
a minimal (non-working) example:
import matplotlib.pyplot plt plt.plot(range(10)) plt.show() returns following error:
c:\anaconda3\python.exe c:/users/john/documents/cpu/master/untitled/main11.py traceback (most recent call last): file "c:/users/john/documents/cpu/master/untitled/main11.py", line 1, in <module> import matplotlib.pyplot plt file "c:\anaconda3\lib\site-packages\matplotlib\pyplot.py", line 29, in <module> import matplotlib.colorbar file "c:\anaconda3\lib\site-packages\matplotlib\colorbar.py", line 34, in <module> import matplotlib.collections collections file "c:\anaconda3\lib\site-packages\matplotlib\collections.py", line 37, in <module> import matplotlib.lines mlines file "c:\anaconda3\lib\site-packages\matplotlib\lines.py", line 28, in <module> matplotlib.markers import markerstyle modulenotfounderror: no module named 'matplotlib.markers' process finished exit code 1 this ran fine 2 weeks ago, not now. knowledge, didn't change or update anything. module loads correctly, seems change in module content? if so: how did happen , how can fix it?
it difficult answer question directly, however, have seen large amount of issues in corporate windows environments pycharm , anaconda these of issues may having
check
pathcorrectly pointing anaconda locationsimport sys sys.pathcheck files have not been migrated
c:\users\username\appdata\roamingteam- purge system
pythondistributions. there may software distributions use internally package ownpythondistribution. can included inpath. example installing anacondac:\having installed inusers\local\appdataor'c:\program files'months before , forgotten!
a way of directly debugging problem navigate following directory in ipython
c:\anaconda3\lib\site-packages\matplotlib and try import matplotlib.markers
if fails then try
import matplotlib matplotlib.__file__ you should check result gives
'c:\\anaconda3\\lib\\site-packages\\matplotlib\\__init__.pyc' as there matplotlib version installed taking precedence. fall under 1 of issues above correct.
Comments
Post a Comment