Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot import name '_png' from 'matplotlib'

I want to use matplotlib instead kivy_garden.graph. Actually, I tried this code to check if it works for me. I've had some problems with installing matplotlib but I have successfully(or not) done that.

When I started the code I got from matplotlib import _png ImportError: cannot import name '_png' from 'matplotlib' (D:\PyCharmProjects\kivyApp\venv\lib\site-packages\matplotlib\__init__.py) I reinstalled matplotlib and pip, tried another version of matplotlib and I don't know why it is not working for me. I have Python 3.7.5, pip 20.2.4 and matplotlib 3.3.3

like image 879
WASP-21b Avatar asked Nov 16 '20 17:11

WASP-21b


2 Answers

Reverting to matplotlib version 3.0.2 didn't work for me, but with 3.1.3 it did.

python -m pip uninstall matplotlib
pip install matplotlib==3.1.3

Python 3.8.2

like image 150
Diego BM Avatar answered Oct 24 '22 09:10

Diego BM


I was having this problem in Google Colab and couldn't solve it. The simple solution that I found was to install the stable version that is pip install -U matplotlib and restarted the runtime and it worked.

like image 4
Muhammad Ahmed Avatar answered Oct 24 '22 07:10

Muhammad Ahmed