日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

win10如何使用pip下载适合自己python版本的matplotlib?(亲测有效)

發布時間:2025/4/5 python 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 win10如何使用pip下载适合自己python版本的matplotlib?(亲测有效) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

請注意:本文基于win10 64位,下面是本次需要下載的所有文件,具體過程請往下閱讀。

安裝完成示意圖:

測試結果
test_matplotlib.py

import matplotlib.pyplot as pltsquares = [1, 4, 9, 16, 25] plt.plot(squares) plt.show()

下面是具體步驟:

第一步:進入網站(注意:所需要的東西都在這個網站!!!)https://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools

第二步:Ctrl+F打開搜索框,搜索matplot,然后找到自己python對應的版本號,見下圖。點擊下載即可。


第三步:將這個.whl文件復制到你的項目文件夾

第四步:按住SHIFT點擊鼠標右鍵,點擊“在此處打開Powershell窗口”。

第五步:使用pip來安裝matplotlib:

pip install <安裝包名>

比如

pip install .\matplotlib-3.3.4-cp38-cp38-win_amd64.whl

善于使用TAB鍵(在大寫鍵上面),可以自動補全后面的文件名,比如上面的matplotlib-3.3.4-cp38-cp38-win_amd64.whl文件,只需要輸入mat然后按tab鍵就可以自動補全。

一般情況下,會遇到錯誤,那么請仔細閱讀下面的話:

注意,下面這句話很重要:當出現錯誤時,提示啥,接著回到步驟一的網站,找到對應的安裝包,下載之!!!。比如這里缺少kiwisolver,那么找到它下載下來。具體情況如下。

如果提醒:

ERROR: Could not find a version that satisfies the requirement kiwisolver>=1.0.1 (from matplotlib)

接著下載之,然后移到自己的項目目錄下。

使用pip install <安裝包名>安裝。顯示安裝成功之后,再重新安裝matplotlib:

pip install .\matplotlib-3.3.4-cp38-cp38-win_amd64.whl

下面情況類似。


如果提醒:

ERROR: Could not find a version that satisfies the requirement cycler>=0.10 (from matplotlib) ERROR: No matching distribution found for cycler>=0.10

如果提醒:

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 python-dateutil>=2.1 (from matplotlib) ERROR: No matching distribution found for python-dateutil>=2.1


如果提醒:

ERROR: Could not find a version that satisfies the requirement pillow>=6.2.0 (from matplotlib) ERROR: No matching distribution found for pillow>=6.2.0

如果提醒:

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命令,導入包,結果如上圖所示,表示成功。

import matplotlib

第七步:編寫函數使用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

總結

以上是生活随笔為你收集整理的win10如何使用pip下载适合自己python版本的matplotlib?(亲测有效)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。