运行环境:python3.8.1 on win32 pip20.0.2 Windows10 64位
参考教程:莫烦PYTHON系列教程
#我的python版本 32位的python3.8.1
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
#我的pip版本 20.0.2
pip 20.0.2 from c:\users\jeans\appdata\local\programs\python\python38-32\lib\site-packages\pip (python 3.8)选择此处进行.whl的正确选择
- 选择Download Files进行.whl文件的挑选
matplotlib-3.1.3-cp36-cp36m-macosx_10_9_x86_64.whl
matplotlib-3.1.3-cp36-cp36m-manylinux1_x86_64.whl
matplotlib-3.1.3-cp36-cp36m-win32.whl
matplotlib-3.1.3-cp36-cp36m-win_amd64.whl
------------------解释---------------------------------
要下载的库名-版本号-cpXX(指的是库支持python的哪个版本,cp36支持python3.6)
-cp36m-所支持的python运行环境:
├── macosx 指mac系统
├── manylinux 指linux系统
├── win32 指运行在32位win上的python,不是指你的windows系统位数
├── win_amd64 指运行在64位win上的python,不是指你的windows系统位数
根据前述,我这边下载的是这个版本:matplotlib-3.1.3-cp38-cp38-win32.whl
(注意是32位的,虽然我windows是64位的,但这里的位数指的是python的运行位数)
!特别注意cpXX标识和位数标识,如果下载有误,后续pip install时会弹出这样的error:
ERROR: matplotlib-3.1.3-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
- 注意:部分pip install弹出error也可能是pip版本低
此时需要将pip的版本进行更新:python -m pip install --upgrade pip
如果表示如下,则可以直接进入pip install
Requirement already up-to-date: pip in c:\users\jeans\appdata\local\programs\python\python38-32\lib\site-packages (20.0.2)
版本更新已经是最新的:在c:\ users \ jeans \ appdata \ local \ programs \ python \ python38-32 \ lib \ site-packages(20.0.2)中的pip
- cmd进入.whl存放目录进行pip install
直接pip install 你刚刚下载完的.whl文件,即:
pip install matplotlib-3.1.3-cp38-cp38-win32.whl