我最近在谷歌 Colab 上制作所需的图表时出现了一个错误,它返回以下错误:
ImportError: 无法从 matplotlib (/usr/local/lib/python3.7/dist-packages/matplotlib/init_.py) 导入名称为 'png' 的模块
这似乎与 matplotlib 版本有关,因为我在互联网上搜索此错误时,其中一种解决方案是:
!pip install matplotlib==3.1.1
它确实有效,但对于 Colab 来说没有太多意义。
我最近在谷歌 Colab 上制作所需的图表时出现了一个错误,它返回以下错误:
ImportError: 无法从 matplotlib (/usr/local/lib/python3.7/dist-packages/matplotlib/init_.py) 导入名称为 'png' 的模块
这似乎与 matplotlib 版本有关,因为我在互联网上搜索此错误时,其中一种解决方案是:
!pip install matplotlib==3.1.1
它确实有效,但对于 Colab 来说没有太多意义。
import matplotlib.pyplot as plt
-> 这里我导入了matplotlib然后我正常调用库plt.hist (array)
- matheus macedo