Matplotlib.pyplot库引入失败?

用Python的人总少不了与Matplotlib接触,可是我们在引入时Python少不了报错。

此时,我们就需要在错误中寻找线索

1.升级pillow库

Matplotlib库依赖PIL(pillow)库。所以它的版本不能太低。若pillow库版本<8.0.0,请升级

pip install --upgrade pillow

2.升级/降级numpy

numpy的版本最好不要太新(也不要太落后),我用的是1.18.1版的。

pip install numpy==指定版本

3.pyparsing、pytz、six、cycler ERROR

四个字:少啥补啥!

4.kiwisolver报错

先检查一下kiwisolver版本

pip list

如kiwisolver≤1.3.1:

pip install kiwisolver==1.4.0

5.大功告成!

你可能感兴趣的:(matplotlib,python)