ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected.
时间: 2023-05-17 14:06:03 浏览: 2415
这个错误提示意味着在使用 matplotlib 作为默认后端时,需要安装 matplotlib 库才能进行绘图。您可以通过运行以下命令来安装 matplotlib 库:
pip install matplotlib
如果您已经安装了 matplotlib 库,但仍然遇到此错误,请确保您的 matplotlib 版本与您的 Python 版本兼容。
相关问题
ImportError: Matplotlib requires numpy>=1.20; you have 1.19.5
这个错误提示是因为你安装的 Matplotlib 版本需要的 numpy 版本大于等于 1.20,而你当前的 numpy 版本为 1.19.5,不满足要求。你需要升级 numpy 版本,可以使用以下命令:
```
pip install numpy --upgrade
```
这将会升级 numpy 到最新版本。升级完成后,再重新安装 Matplotlib 即可。
import matplotlib.pyplot as plt ImportError: Matplotlib requires numpy>=1.20; you have 1.19.5
这个错误是因为您的matplotlib库版本过低,而需要的numpy版本要求大于等于1.20。您可以通过升级numpy来解决这个问题。运行以下命令来升级numpy:
```shell
pip install --upgrade numpy
```
升级完成后,再次导入matplotlib库应该就不会出现这个错误了。