win10如何使用pip下载适合自己python版本的matplotlib?(亲测有效)
文章目錄
請注意:本文基于win10 64位,下面是本次需要下載的所有文件,具體過程請往下閱讀。
安裝完成示意圖:
測試結(jié)果
test_matplotlib.py
下面是具體步驟:
第一步:進(jìn)入網(wǎng)站(注意:所需要的東西都在這個(gè)網(wǎng)站!!!)https://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools
第二步:Ctrl+F打開搜索框,搜索matplot,然后找到自己python對應(yīng)的版本號(hào),見下圖。點(diǎn)擊下載即可。
第三步:將這個(gè).whl文件復(fù)制到你的項(xiàng)目文件夾
第四步:按住SHIFT點(diǎn)擊鼠標(biāo)右鍵,點(diǎn)擊“在此處打開Powershell窗口”。
第五步:使用pip來安裝matplotlib:
pip install <安裝包名>比如
pip install .\matplotlib-3.3.4-cp38-cp38-win_amd64.whl善于使用TAB鍵(在大寫鍵上面),可以自動(dòng)補(bǔ)全后面的文件名,比如上面的matplotlib-3.3.4-cp38-cp38-win_amd64.whl文件,只需要輸入mat然后按tab鍵就可以自動(dòng)補(bǔ)全。
一般情況下,會(huì)遇到錯(cuò)誤,那么請仔細(xì)閱讀下面的話:
注意,下面這句話很重要:當(dāng)出現(xiàn)錯(cuò)誤時(shí),提示啥,接著回到步驟一的網(wǎng)站,找到對應(yīng)的安裝包,下載之!!!。比如這里缺少kiwisolver,那么找到它下載下來。具體情況如下。
如果提醒:
ERROR: Could not find a version that satisfies the requirement kiwisolver>=1.0.1 (from matplotlib)接著下載之,然后移到自己的項(xiàng)目目錄下。
使用pip install <安裝包名>安裝。顯示安裝成功之后,再重新安裝matplotlib:
下面情況類似。
如果提醒:
如果提醒:
ERROR: Could not find a version that satisfies the requirement six (from cycler) ERROR: No matching distribution found for six
如果提醒:
如果提醒:
如果提醒:
ERROR: Could not find a version that satisfies the requirement pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 (from matplotlib) ERROR: No matching distribution found for pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3終于安裝成功了!!!
第六步:輸入python命令,導(dǎo)入包,結(jié)果如上圖所示,表示成功。
import matplotlib第七步:編寫函數(shù)使用matplotlib。
test_matplotlib.py
import matplotlib.pyplot as pltsquares = [1, 4, 9, 16, 25] plt.plot(squares) plt.show()參考:
[1]https://blog.csdn.net/shizheng_Li/article/details/114731202?spm=1001.2014.3001.5501
[2]https://blog.csdn.net/u010002387/article/details/48784707?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control&dist_request_id=&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control
總結(jié)
以上是生活随笔為你收集整理的win10如何使用pip下载适合自己python版本的matplotlib?(亲测有效)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python基础学习[python编程从
- 下一篇: CSP认证202012-1期末预测之安全