Problem initializing package using matplotlib

已回答

When I launch my application from within PyCharm, I get the following traceback:

Traceback (most recent call last):
File "_pydevd_bundle/pydevd_cython_darwin_36_64.pyx", line 446, in _pydevd_bundle.pydevd_cython_darwin_36_64.PyDBFrame.handle_exception
File "_pydevd_bundle/pydevd_cython_darwin_36_64.pyx", line 254, in _pydevd_bundle.pydevd_cython_darwin_36_64.PyDBFrame.do_wait_suspend
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 809, in do_wait_suspend
self._activate_mpl_if_needed()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 417, in _activate_mpl_if_needed
activate_function()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 408, in <lambda>
self.mpl_modules_for_patching = {"matplotlib": lambda: activate_matplotlib(do_enable_gui),
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython/matplotlibtools.py", line 93, in activate_matplotlib
gui, backend = find_gui_and_backend()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython/matplotlibtools.py", line 47, in find_gui_and_backend
backend = matplotlib.rcParams['backend']
AttributeError: module 'matplotlib' has no attribute 'rcParams'

There have obviously been several issues such as this over the past few years, but none of the solutions appear relevant and this only started happening for me with the latest update to PyCharm 2017.3.3. I am running Python 3.6 within a conda environment. When I run the application outside PyCharm, this error does not appear, so presumably, PyCharm is trying to use a different matplotlib when launching. I can't see how to edit the run configuration to make sure this doesn't happen. 

 

0

Hi Rosborn! Could you please create a ticket in our bug tracker and attach idea.log from Help | Show Log in ... there? What matplotlib version do you use?

0
Avatar
Permanently deleted user

I have created ticket #PY-28081 with the requested information.

Thanks, Ray

0

请先登录再写评论。