32
votes

I can run my program in the terminal, but when I run it directly using Pycharm, it gives

AttributeError: module 'matplotlib' has no attribute 'verbose'

enter image description here

5
You should copy and paste the code and the error message in the question, rather than uploading a screenshot - DavidG
I'm having the exact same issue. It worked fine in the PyCharm Community edition, but when I updated to PyCharm Professional I get this same error. As soon as my code tries to "import matplotlib.pyplot as plt' - Tom Johnson
Could you please edit the question to include the code and error message in text form. Only then people will be able to find this through search. - ImportanceOfBeingErnest

5 Answers

36
votes

I think I found the answer. I was having the same problem. In PyCharm Professional 2017.3, go to File | Settings | Tools | Python Scientific. There is an option there to "Show plots in toolwindow". Uncheck this option. Then it should work ok. It has something to do with PyCharm trying to help you by allowing you to interact with your plots - as hinted at in this issue discussion. https://youtrack.jetbrains.com/issue/PY-26652

12
votes

Try to install older version of matplotlib like 2.1.0 rather than v 2.2.0

use:

pip uninstall matplotlib
pip install matplotlib==2.1.0
6
votes

This is an error on the matplotlib side, verbose was unintentionally removed in matplotlib 2.2.0. See this issue.

This is fixed from the matplotlib side as of version 2.2.2. (Release here)

If updating is not an option, one less ideal option could be to locate the __init__.py inside the matplotlib folder, and add the line

verbose = Verbose()

after the Verbose() class - that should be around line 384 in the current version.

0
votes

if anyone is having issue such as: module matplotlib has no attribute 'artist'. Try this method below by removing matplotlib

pip uninstall matplotlib

then reinstall it again worked for me

pip install matplotlib==3.0.0
0
votes

In the most recent version of PyCharm (Profession 2020.2), this issue if fixed. You can use matplotlib 2.2.0+ and make use of the "Show plots in tool window" feature at the same time.