###1.首先,确保环境(虚拟环境)中已经安装了matplotlib模块python
###2.肯定你的pycharm 使用的环境是你的虚拟环境 ####(1)在pycharm中添加虚拟环境 pycharm默认使用的环境可能并非你想用的虚拟环境: python3.x
如图在file->settings 里面能够找到配置虚拟环境的窗口。.net
(注意:4就是你虚拟环境中包含的模块或者软件)3d
####(2)在pycharm中添加虚拟环境的方法code
####(3)而后能够在项目中选择你配置的环境:
blog
###3.修改pycharm配置get
from matplotlib import pyplot as plt x = range(2,26,2) y = [15,13,14,17,20,25,26,26,24,22,18,15] plt.plot(x,y) plt.show()
参考文章:https://blog.csdn.net/qq_41472037/article/details/100100562pycharm