1.检查python安装,是不是多版本并存,pycharm指向的不是3.9.6的python
2.命令行下执行from matplotlib import pyplot as plt
如果正常说明pythcharm配置有误;
如果执行有误,uninstall 然后重新pip install
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> from matplotlib import pyplot
>>> from matplotlib import pyplot as plt
>>>