0

This question is exactly the same to the previous question here. I installed python 3.9 or 3.10 and matplotlib 3.6.0 in Sep 20th 2022, and I have the error below. Gaff had the exactly same error. How can I solve this issue?

Matplotlib support failed 
Traceback (most recent call last): 
  File "C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 25, in do_import
    succeeded = activate_func() 
  File "C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_code_executor.py", line 29, in <lambda>
    "matplotlib": lambda: activate_matplotlib(self.enableGui), 
  File "C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev\pydev_ipython\matplotlibtools.py", line 110, in activate_matplotlib
    gui, backend = find_gui_and_backend() 
  File "C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev\pydev_ipython\matplotlibtools.py", line 47, in find_gui_and_backend
    backend = matplotlib.rcParams['backend'] 
  File "D:\books\programming\python17\lib\site-packages\matplotlib\__init__.py", line 677, in __getitem__
    plt.switch_backend(rcsetup._auto_backend_sentinel) 
  File "D:\books\programming\python17\lib\site-packages\matplotlib\pyplot.py", line 251, in switch_backend
    switch_backend(candidate) 
  File "D:\books\programming\python17\lib\site-packages\matplotlib\pyplot.py", line 266, in switch_backend
    canvas_class = backend_mod.FigureCanvas 
AttributeError: partially initialized module 'matplotlib.backends.backend_macosx' has no attribute 'FigureCanvas' (most likely due to a circular import)
    
Process finished with exit code 0
E_net4
  • 27,810
  • 13
  • 101
  • 139
Sungwoo
  • 19
  • 4

1 Answers1

0

My solution was just adding 'import matplotlib' as shown below.

import matplotlib
import matplotlib.pyplot as plt

Then the code works like a charm. If I remove the 'import matplotlib' line, then the error happens again. I do not think this is an appropriate answer because I need to add the 'import matplotlib' to every codes.

The previous version of matplotlib in a different computer does not have this issue. My guess is that there might be a bug in the new 3.6.0 version.

Please share another brilliant solution to fix this issue more easily.

Sungwoo
  • 19
  • 4