Description
Bug summary
When trying to run plt.show the graph isn't being shown and instead the following error is raised:
'NoneType' object has no attribute 'pyplot_show'
Code for reproduction
import matplotlib.pyplot as plt
import numpy as np
# from tests import generate_fake_data
x = [i for i in range(10)]# generate_fake_data.generate_time_data()
y = [i for i in range(10)] # list(np.random.rand(10))
fig, ax = plt.subplots()
ax.plot(x, y, linewidth=2.0)
plt.show()
Actual outcome
Matplotlib support failed
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 25, in do_import
succeeded = activate_func()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_code_executor.py", line 27, in
"matplotlib": lambda: activate_matplotlib(self.enableGui),
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\pydev_ipython\matplotlibtools.py", line 110, in activate_matplotlib
gui, backend = find_gui_and_backend()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\pydev_ipython\matplotlibtools.py", line 47, in find_gui_and_backend
backend = matplotlib.rcParams['backend']
File "C:\Users\jopva\Projects\rws-dataviz\venv\lib\site-packages\matplotlib_init_.py", line 777, in getitem
plt.switch_backend(rcsetup._auto_backend_sentinel)
File "C:\Users\jopva\Projects\rws-dataviz\venv\lib\site-packages\matplotlib\pyplot.py", line 256, in switch_backend
switch_backend(candidate)
File "C:\Users\jopva\Projects\rws-dataviz\venv\lib\site-packages\matplotlib\pyplot.py", line 337, in switch_backend
backend_mod.show = manager_class.pyplot_show
AttributeError: 'NoneType' object has no attribute 'pyplot_show'
Expected outcome
Show a chart
Additional information
It worked fine on 3.7.0
Downgrading to version 3.7.0 fixes it.
Operating system
Windows 11
Matplotlib Version
3.7.2
Matplotlib Backend
TkAgg
Python version
3.9.6
Jupyter version
No response
Installation
None