matplotlib下載安裝過程同之前寫的pygame很類似。
Pygame下載安裝
python官網
1.搜索matplotlib
直接點進去
查看歷史版本,因為新版本可能出現與python不匹配問題。
我選擇3.6.3版本,因為我安裝的python是3.8,可以匹配版本。同時window操作系統64位,所以選win-amd64
2.下載
下載保存到python安裝地址的sit-package即可。不知道的參考我上面的Pygame博客。在文件夾地址輸入cmd,使用命令安裝即可:
3.檢測
win+r打開黑框,輸入python,然后import matplotlib.
如果沒有出現任何錯誤消息,就說明你的系統安裝好了matplotlib
后記
使用matplotlib出現這種類型錯誤:
MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.plt.plot(squares)
設置里面取消即可:
參考鏈接:pycharm畫圖警告