Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't make plots on the colab with matplotlib

I recently had an error in google colab to make the plots I need. It pame returns the following error.

ImportError: cannot import name 'png' from 'matplotlib' (/usr/local/lib/python3.7/dist-packages/matplotlib/init_.py)

It seems that it is connected with the version of matplotlib, because I looked for this error on the internet and one of the solutions was:

!pip install matplotlib == 3.1.1

It works, but it doesn't make much sense when it comes to Colab

like image 455
matheus macedo Avatar asked Oct 28 '25 17:10

matheus macedo


1 Answers

thanks for the code:

!pip install matplotlib == 3.1.1

it work on my colan

like image 176
Olivia Wang Avatar answered Oct 31 '25 06:10

Olivia Wang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!