Python 在windows7上的最终版本3.8.8的下载安装,请见:
《Python 3.8.8 以及 openpyxl 3.0.7 的下载和安装!》
安装完成后,打开cmd控制台进入python安装路径,键入: pip list (安装python时已Add Python 3.8 to Path)
E:\Python>pip list Package Version ---------- ------- pip 20.2.3 setuptools 49.2.1 WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available. You should consider upgrading via the 'e:\python\python.exe -m pip install --upgrade pip' command.
提示 pip 有新版本,先搞定这个;本文所有库文件的下载地址见本文末尾,且下载完了可以在本地离线安装。
注:本文安装的库文件下载后均存放在python安装路径下: E:\Python
pip的升级安装
最新版本:pip-21.0.1-py3-none-any.whl
点击下载whl (1.5 MB) | Wheel | py3 | Jan 30, 2021 |
E:\Python>python -m pip install pip-21.0.1-py3-none-any.whl Processing e:\python\pip-21.0.1-py3-none-any.whl Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 20.2.3 Uninstalling pip-20.2.3: Successfully uninstalled pip-20.2.3 Successfully installed pip-21.0.1 E:\Python>pip list Package Version ---------- ------- pip 21.0.1 setuptools 49.2.1
tkinter库的安装
安装python3.8.8时默认选择“tcl/tk and IDLE”,就内置tkinter库不用安装了。
E:\Python>python Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AM D64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>>
openpyxl的安装
最新版本:openpyxl-3.0.7-py2.py3-none-any.whl (可以操作Excel2010的xlsx, xlsm等文件)
点击下载whl (243.2 kB) | Wheel | py2.py3 | Mar 10, 2021 |
E:\Python>pip install openpyxl-3.0.7-py2.py3-none-any.whl Processing e:\python\openpyxl-3.0.7-py2.py3-none-any.whl WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status =None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con nection.HTTPSConnection object at 0x0000000004106970>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/et-xmlfile/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status =None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con nection.HTTPSConnection object at 0x0000000004138430>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/et-xmlfile/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status =None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con nection.HTTPSConnection object at 0x0000000004138520>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/et-xmlfile/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status =None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con nection.HTTPSConnection object at 0x00000000041381F0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/et-xmlfile/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status =None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con nection.HTTPSConnection object at 0x0000000004138F70>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed')': /simple/et-xmlfile/ ERROR: Could not find a version that satisfies the requirement et-xmlfile (from openpyxl) ERROR: No matching distribution found for et-xmlfile
离线状态直接安装会出错,先要安装其依赖库: ex-xmlfile 和 ex-xmlfile-2021
最新版本: et_xmlfile-1.0.1.tar.gz 、 et_xmlfile_2021-1.0.2-py3-none-any.whl
1.0.2点击下载whl (8.8 kB) | Wheel | py3 | Mar 6, 2021 |
1.0.1点击下载.tar.gz (8.4 kB) | Source | None | Oct 27, 2015 |
注:其中et_xmlfile-1.0.1未提供.whl文件,安装方法相同。
E:\Python>pip install et_xmlfile-1.0.1.tar.gz Processing e:\python\et_xmlfile-1.0.1.tar.gz Using legacy 'setup.py install' for et-xmlfile, since package 'wheel' is not installed. Installing collected packages: et-xmlfile Running setup.py install for et-xmlfile ... done Successfully installed et-xmlfile-1.0.1 E:\Python>pip install et_xmlfile_2021-1.0.2-py3-none-any.whl Processing e:\python\et_xmlfile_2021-1.0.2-py3-none-any.whl Installing collected packages: et-xmlfile-2021 Successfully installed et-xmlfile-2021-1.0.2 E:\Python>pip install openpyxl-3.0.7-py2.py3-none-any.whl Processing e:\python\openpyxl-3.0.7-py2.py3-none-any.whl Requirement already satisfied: et-xmlfile in e:\python\lib\site-packages (from penpyxl==3.0.7) (1.0.1) Installing collected packages: openpyxl Successfully installed openpyxl-3.0.7 E:\>pip list Package Version --------------- ------- et-xmlfile 1.0.1 et-xmlfile-2021 1.0.2 openpyxl 3.0.7 pip 21.0.1 setuptools 49.2.1
PyMySQL的安装
最新版本:PyMySQL-1.0.2-py3-none-any.whl
点击下载 (43.8 kB) | Wheel | py3 | Jan 9, 2021 |
E:\Python>pip install PyMySQL-1.0.2-py3-none-any.whl Processing e:\python\pymysql-1.0.2-py3-none-any.whl Installing collected packages: PyMySQL Successfully installed PyMySQL-1.0.2 E:\>pip list Package Version --------------- ------- et-xmlfile 1.0.1 et-xmlfile-2021 1.0.2 openpyxl 3.0.7 pip 21.0.1 PyMySQL 1.0.2 setuptools 49.2.1
使用实例:
import pymysql # 打开数据库连接 db = pymysql.connect(host = "10.1.1.24", user ="root", password ="123456", db ="exam", port =3306) # 使用cursor()方法 cursor = db.cursor() # 使用execute方法执行SQL语句 cursor.execute("SELECT VERSION()") # 使用 fetchone() 方法获取一条数据 data = cursor.fetchone() print ("Database version : %s " % data) cursor.execute("SELECT * from USERS ") # 使用 fetchone() 方法获取所有数据 results = cursor.fetchall() for it in results: for i in range(len(it)): print (it[i]) # 关闭数据库连接 db.close()
PyAutoGUI的安装
最新版本: PyAutoGUI-0.9.52.tar.gz
相关依赖库太多,离线安装要下载以下8个还要满足一定先后安装顺序:
Pillow 8.1.2
PyMsgBox 1.0.9
PyScreeze 0.1.26
PyTweening 1.0.3
pyperclip 1.8.2
PyRect 0.1.4
MouseInfo 0.1.3
PyGetWindow 0.0.9
所以不一一列举所有下载地址,等全部装完再统一制作离线安装包。继续安装package以下第四个起:
openpyxl PyMySQL PyAutoGUI
numpy Pandas matplotlib SciPy
PyBrain ipython Seaborn Anaconda
esptool jupyter pywin32 pyinstaller
装完之后的全部库清单:
E:\Python>pip list
Package Version
------------------------- ---------
altgraph 0.17
anaconda 0.0.1.1
argon2-cffi 20.1.0
async-generator 1.10
attrs 20.3.0
backcall 0.2.0
bitstring 3.1.7
bleach 3.3.0
cffi 1.14.5
colorama 0.4.4
cryptography 3.4.6
cycler 0.10.0
decorator 4.4.2
defusedxml 0.7.1
ecdsa 0.16.1
entrypoints 0.3
esptool 3.0
et-xmlfile 1.0.1
et-xmlfile-2021 1.0.2
future 0.18.2
ipykernel 5.5.0
ipython 7.21.0
ipython-genutils 0.2.0
ipywidgets 7.6.3
jedi 0.18.0
Jinja2 2.11.3
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.12
jupyter-console 6.3.0
jupyter-core 4.7.1
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.0.0
kiwisolver 1.3.1
MarkupSafe 1.1.1
matplotlib 3.3.4
mistune 0.8.4
MouseInfo 0.1.3
nbclient 0.5.3
nbconvert 6.0.7
nbformat 5.1.2
nest-asyncio 1.5.1
notebook 6.2.0
numpy 1.20.1
openpyxl 3.0.7
packaging 20.9
pandas 1.2.3
pandocfilters 1.4.3
parso 0.8.1
pefile 2019.4.18
pickleshare 0.7.5
Pillow 8.1.2
pip 21.0.1
prometheus-client 0.9.0
prompt-toolkit 3.0.17
PyAutoGUI 0.9.52
PyBrain 0.3
pycparser 2.20
PyGetWindow 0.0.9
Pygments 2.8.1
pyinstaller 4.2
pyinstaller-hooks-contrib 2021.1
PyMsgBox 1.0.9
PyMySQL 1.0.2
pyparsing 2.4.7
pyperclip 1.8.2
PyRect 0.1.4
pyrsistent 0.17.3
PyScreeze 0.1.26
pyserial 3.5
python-dateutil 2.8.1
PyTweening 1.0.3
pytz 2021.1
pywin32 300
pywin32-ctypes 0.2.0
pywinpty 0.5.7
pyzmq 22.0.3
qtconsole 5.0.3
QtPy 1.9.0
reedsolo 1.5.4
scipy 1.6.1
seaborn 0.11.1
Send2Trash 1.5.0
setuptools 49.2.1
six 1.15.0
terminado 0.9.3
testpath 0.4.4
tornado 6.1
traitlets 5.0.5
wcwidth 0.2.5
webencodings 0.5.1
widgetsnbextension 3.5.1
E:\Python>
Packages官方网站
Find, install and publish Python packages with the Python Package Index
网站地址:PyPI · The Python Package Index
有网络在线时可到官方或镜像网站上搜索、下载 Package。
清华大学 pypi 镜像网站
网站地址:pypi.tuna.tsinghua.edu.cn
pypi 镜像每 5 分钟同步一次。
使用方法:参数 -i 指定镜像源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
注意,simple 不能少, url是https协议,参数-i url可以在package后
设为默认
升级 pip 到最新的版本 (>=10.0.0) 后进行配置:
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
如果默认源的网络连接较差,可以使用镜像站;除了这个清华源还有:
豆瓣源: https://pypi.douban.com/simple/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
安装实例:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U (升级pip自己)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
也可以多个一起安装:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ image qrcode pillow
制作离线安装包
1. E:\Python>pip freeze > PackageList.txt 2. 3. E:\Python>pip download -d .\Packages -r PackageList.txt
全部下载后 E:\Python\packages\ 路径下有91个文件约100M,记得把 PackageList.txt 和 pip-21.0.1-py3-none-any.whl 也放进去,然后把整个目录压缩打包备用。
E:\Python>pip download -d .\Packages -r PackageList.txt Processing e:\python\et_xmlfile_2021-1.0.2-py3-none-any.whl Processing e:\python\openpyxl-3.0.7-py2.py3-none-any.whl Processing e:\python\pillow-8.1.2-cp38-cp38-win_amd64.whl Processing e:\python\pymsgbox-1.0.9-py3-none-any.whl Processing e:\python\pymysql-1.0.2-py3-none-any.whl Collecting altgraph==0.17 Using cached altgraph-0.17-py2.py3-none-any.whl (21 kB) Collecting anaconda==0.0.1.1 Using cached anaconda-0.0.1.1.tar.gz (726 bytes) Collecting argon2-cffi==20.1.0 Using cached argon2_cffi-20.1.0-cp38-cp38-win_amd64.whl (42 kB) Collecting async-generator==1.10 Using cached async_generator-1.10-py3-none-any.whl (18 kB) Collecting attrs==20.3.0 Using cached attrs-20.3.0-py2.py3-none-any.whl (49 kB) Collecting backcall==0.2.0 Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB) Collecting bitstring==3.1.7 Using cached bitstring-3.1.7.tar.gz (195 kB) Collecting bleach==3.3.0 Using cached bleach-3.3.0-py2.py3-none-any.whl (283 kB) Collecting cffi==1.14.5 Using cached cffi-1.14.5-cp38-cp38-win_amd64.whl (179 kB) Collecting colorama==0.4.4 Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB) Collecting cryptography==3.4.6 Using cached cryptography-3.4.6-cp36-abi3-win_amd64.whl (1.6 MB) Collecting cycler==0.10.0 Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB) Collecting decorator==4.4.2 Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB) Collecting defusedxml==0.7.1 Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB) Collecting ecdsa==0.16.1 Using cached ecdsa-0.16.1-py2.py3-none-any.whl (104 kB) Collecting entrypoints==0.3 Using cached entrypoints-0.3-py2.py3-none-any.whl (11 kB) Collecting esptool==3.0 Using cached esptool-3.0.tar.gz (149 kB) Collecting et-xmlfile==1.0.1 Using cached et_xmlfile-1.0.1.tar.gz (8.4 kB) Collecting future==0.18.2 Using cached future-0.18.2.tar.gz (829 kB) Collecting ipykernel==5.5.0 Using cached ipykernel-5.5.0-py3-none-any.whl (120 kB) Collecting ipython==7.21.0 Using cached ipython-7.21.0-py3-none-any.whl (784 kB) Collecting ipython-genutils==0.2.0 Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB) Collecting ipywidgets==7.6.3 Using cached ipywidgets-7.6.3-py2.py3-none-any.whl (121 kB) Collecting jedi==0.18.0 Using cached jedi-0.18.0-py2.py3-none-any.whl (1.4 MB) Collecting Jinja2==2.11.3 Using cached Jinja2-2.11.3-py2.py3-none-any.whl (125 kB) Collecting jsonschema==3.2.0 Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB) Collecting jupyter==1.0.0 Using cached jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB) Collecting jupyter-client==6.1.12 Using cached jupyter_client-6.1.12-py3-none-any.whl (112 kB) Collecting jupyter-console==6.3.0 Using cached jupyter_console-6.3.0-py3-none-any.whl (22 kB) Collecting jupyter-core==4.7.1 Using cached jupyter_core-4.7.1-py3-none-any.whl (82 kB) Collecting jupyterlab-pygments==0.1.2 Using cached jupyterlab_pygments-0.1.2-py2.py3-none-any.whl (4.6 kB) Collecting jupyterlab-widgets==1.0.0 Using cached jupyterlab_widgets-1.0.0-py3-none-any.whl (243 kB) Collecting kiwisolver==1.3.1 Using cached kiwisolver-1.3.1-cp38-cp38-win_amd64.whl (51 kB) Collecting MarkupSafe==1.1.1 Using cached MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl (16 kB) Collecting matplotlib==3.3.4 Using cached matplotlib-3.3.4-cp38-cp38-win_amd64.whl (8.5 MB) Collecting mistune==0.8.4 Using cached mistune-0.8.4-py2.py3-none-any.whl (16 kB) Collecting MouseInfo==0.1.3 Using cached MouseInfo-0.1.3.tar.gz (10 kB) Collecting nbclient==0.5.3 Using cached nbclient-0.5.3-py3-none-any.whl (82 kB) Collecting nbconvert==6.0.7 Using cached nbconvert-6.0.7-py3-none-any.whl (552 kB) Collecting nbformat==5.1.2 Using cached nbformat-5.1.2-py3-none-any.whl (113 kB) Collecting nest-asyncio==1.5.1 Using cached nest_asyncio-1.5.1-py3-none-any.whl (5.0 kB) Collecting notebook==6.2.0 Using cached notebook-6.2.0-py3-none-any.whl (9.5 MB) Collecting numpy==1.20.1 Using cached numpy-1.20.1-cp38-cp38-win_amd64.whl (13.7 MB) Collecting packaging==20.9 Using cached packaging-20.9-py2.py3-none-any.whl (40 kB) Collecting pandas==1.2.3 Using cached pandas-1.2.3-cp38-cp38-win_amd64.whl (9.3 MB) Collecting pandocfilters==1.4.3 Using cached pandocfilters-1.4.3.tar.gz (16 kB) Collecting parso==0.8.1 Using cached parso-0.8.1-py2.py3-none-any.whl (93 kB) Collecting pefile==2019.4.18 Using cached pefile-2019.4.18.tar.gz (62 kB) Collecting pickleshare==0.7.5 Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB) Collecting prometheus-client==0.9.0 Using cached prometheus_client-0.9.0-py2.py3-none-any.whl (53 kB) Collecting prompt-toolkit==3.0.17 Using cached prompt_toolkit-3.0.17-py3-none-any.whl (367 kB) Collecting PyAutoGUI==0.9.52 Using cached PyAutoGUI-0.9.52.tar.gz (55 kB) Collecting PyBrain==0.3 Using cached PyBrain-0.3.tar.gz (262 kB) Collecting pycparser==2.20 Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB) Collecting PyGetWindow==0.0.9 Using cached PyGetWindow-0.0.9.tar.gz (9.7 kB) Collecting Pygments==2.8.1 Using cached Pygments-2.8.1-py3-none-any.whl (983 kB) Collecting pyinstaller==4.2 Using cached pyinstaller-4.2.tar.gz (3.6 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Collecting pyinstaller-hooks-contrib==2021.1 Using cached pyinstaller_hooks_contrib-2021.1-py2.py3-none-any.whl (181 kB) Collecting pyparsing==2.4.7 Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB) Collecting pyperclip==1.8.2 Using cached pyperclip-1.8.2.tar.gz (20 kB) Collecting PyRect==0.1.4 Using cached PyRect-0.1.4.tar.gz (15 kB) Collecting pyrsistent==0.17.3 Using cached pyrsistent-0.17.3.tar.gz (106 kB) Collecting PyScreeze==0.1.26 Using cached PyScreeze-0.1.26.tar.gz (23 kB) Collecting pyserial==3.5 Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB) Collecting python-dateutil==2.8.1 Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB) Collecting PyTweening==1.0.3 Using cached PyTweening-1.0.3.zip (15 kB) Collecting pytz==2021.1 Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB) Collecting pywin32==300 Using cached pywin32-300-cp38-cp38-win_amd64.whl (9.3 MB) Collecting pywin32-ctypes==0.2.0 Using cached pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB) Collecting pywinpty==0.5.7 Using cached pywinpty-0.5.7-cp38-cp38-win_amd64.whl (1.3 MB) Collecting pyzmq==22.0.3 Using cached pyzmq-22.0.3-cp38-cp38-win_amd64.whl (1.2 MB) Collecting qtconsole==5.0.3 Using cached qtconsole-5.0.3-py3-none-any.whl (119 kB) Collecting QtPy==1.9.0 Using cached QtPy-1.9.0-py2.py3-none-any.whl (54 kB) Collecting reedsolo==1.5.4 Using cached reedsolo-1.5.4.tar.gz (271 kB) Collecting scipy==1.6.1 Using cached scipy-1.6.1-cp38-cp38-win_amd64.whl (32.7 MB) Collecting seaborn==0.11.1 Using cached seaborn-0.11.1-py3-none-any.whl (285 kB) Collecting Send2Trash==1.5.0 Using cached Send2Trash-1.5.0-py3-none-any.whl (12 kB) Collecting six==1.15.0 Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting terminado==0.9.3 Using cached terminado-0.9.3-py3-none-any.whl (14 kB) Collecting testpath==0.4.4 Using cached testpath-0.4.4-py2.py3-none-any.whl (163 kB) Collecting tornado==6.1 Using cached tornado-6.1-cp38-cp38-win_amd64.whl (422 kB) Collecting traitlets==5.0.5 Using cached traitlets-5.0.5-py3-none-any.whl (100 kB) Collecting wcwidth==0.2.5 Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB) Collecting webencodings==0.5.1 Using cached webencodings-0.5.1-py2.py3-none-any.whl (11 kB) Collecting widgetsnbextension==3.5.1 Using cached widgetsnbextension-3.5.1-py2.py3-none-any.whl (2.2 MB) Collecting setuptools>=18.5 Using cached setuptools-54.1.2-py3-none-any.whl (785 kB) Saved e:\python\packages\et_xmlfile_2021-1.0.2-py3-none-any.whl Saved e:\python\packages\openpyxl-3.0.7-py2.py3-none-any.whl Saved e:\python\packages\pillow-8.1.2-cp38-cp38-win_amd64.whl Saved e:\python\packages\pymsgbox-1.0.9-py3-none-any.whl Saved e:\python\packages\pymysql-1.0.2-py3-none-any.whl Saved e:\python\packages\altgraph-0.17-py2.py3-none-any.whl Saved e:\python\packages\anaconda-0.0.1.1.tar.gz Saved e:\python\packages\argon2_cffi-20.1.0-cp38-cp38-win_amd64.whl Saved e:\python\packages\async_generator-1.10-py3-none-any.whl Saved e:\python\packages\attrs-20.3.0-py2.py3-none-any.whl Saved e:\python\packages\backcall-0.2.0-py2.py3-none-any.whl Saved e:\python\packages\bitstring-3.1.7.tar.gz Saved e:\python\packages\bleach-3.3.0-py2.py3-none-any.whl Saved e:\python\packages\cffi-1.14.5-cp38-cp38-win_amd64.whl Saved e:\python\packages\colorama-0.4.4-py2.py3-none-any.whl Saved e:\python\packages\cryptography-3.4.6-cp36-abi3-win_amd64.whl Saved e:\python\packages\cycler-0.10.0-py2.py3-none-any.whl Saved e:\python\packages\decorator-4.4.2-py2.py3-none-any.whl Saved e:\python\packages\defusedxml-0.7.1-py2.py3-none-any.whl Saved e:\python\packages\ecdsa-0.16.1-py2.py3-none-any.whl Saved e:\python\packages\entrypoints-0.3-py2.py3-none-any.whl Saved e:\python\packages\esptool-3.0.tar.gz Saved e:\python\packages\et_xmlfile-1.0.1.tar.gz Saved e:\python\packages\future-0.18.2.tar.gz Saved e:\python\packages\ipykernel-5.5.0-py3-none-any.whl Saved e:\python\packages\ipython-7.21.0-py3-none-any.whl Saved e:\python\packages\ipython_genutils-0.2.0-py2.py3-none-any.whl Saved e:\python\packages\ipywidgets-7.6.3-py2.py3-none-any.whl Saved e:\python\packages\jedi-0.18.0-py2.py3-none-any.whl Saved e:\python\packages\jinja2-2.11.3-py2.py3-none-any.whl Saved e:\python\packages\jsonschema-3.2.0-py2.py3-none-any.whl Saved e:\python\packages\jupyter-1.0.0-py2.py3-none-any.whl Saved e:\python\packages\jupyter_client-6.1.12-py3-none-any.whl Saved e:\python\packages\jupyter_console-6.3.0-py3-none-any.whl Saved e:\python\packages\jupyter_core-4.7.1-py3-none-any.whl Saved e:\python\packages\jupyterlab_pygments-0.1.2-py2.py3-none-any.whl Saved e:\python\packages\jupyterlab_widgets-1.0.0-py3-none-any.whl Saved e:\python\packages\kiwisolver-1.3.1-cp38-cp38-win_amd64.whl Saved e:\python\packages\markupsafe-1.1.1-cp38-cp38-win_amd64.whl Saved e:\python\packages\matplotlib-3.3.4-cp38-cp38-win_amd64.whl Saved e:\python\packages\mistune-0.8.4-py2.py3-none-any.whl Saved e:\python\packages\mouseinfo-0.1.3.tar.gz Saved e:\python\packages\nbclient-0.5.3-py3-none-any.whl Saved e:\python\packages\nbconvert-6.0.7-py3-none-any.whl Saved e:\python\packages\nbformat-5.1.2-py3-none-any.whl Saved e:\python\packages\nest_asyncio-1.5.1-py3-none-any.whl Saved e:\python\packages\notebook-6.2.0-py3-none-any.whl Saved e:\python\packages\numpy-1.20.1-cp38-cp38-win_amd64.whl Saved e:\python\packages\packaging-20.9-py2.py3-none-any.whl Saved e:\python\packages\pandas-1.2.3-cp38-cp38-win_amd64.whl Saved e:\python\packages\pandocfilters-1.4.3.tar.gz Saved e:\python\packages\parso-0.8.1-py2.py3-none-any.whl Saved e:\python\packages\pefile-2019.4.18.tar.gz Saved e:\python\packages\pickleshare-0.7.5-py2.py3-none-any.whl Saved e:\python\packages\prometheus_client-0.9.0-py2.py3-none-any.whl Saved e:\python\packages\prompt_toolkit-3.0.17-py3-none-any.whl Saved e:\python\packages\pyautogui-0.9.52.tar.gz Saved e:\python\packages\pybrain-0.3.tar.gz Saved e:\python\packages\pycparser-2.20-py2.py3-none-any.whl Saved e:\python\packages\pygetwindow-0.0.9.tar.gz Saved e:\python\packages\pygments-2.8.1-py3-none-any.whl Saved e:\python\packages\pyinstaller-4.2.tar.gz Saved e:\python\packages\pyinstaller_hooks_contrib-2021.1-py2.py3-none-any.whl Saved e:\python\packages\pyparsing-2.4.7-py2.py3-none-any.whl Saved e:\python\packages\pyperclip-1.8.2.tar.gz Saved e:\python\packages\pyrect-0.1.4.tar.gz Saved e:\python\packages\pyrsistent-0.17.3.tar.gz Saved e:\python\packages\pyscreeze-0.1.26.tar.gz Saved e:\python\packages\pyserial-3.5-py2.py3-none-any.whl Saved e:\python\packages\python_dateutil-2.8.1-py2.py3-none-any.whl Saved e:\python\packages\pytweening-1.0.3.zip Saved e:\python\packages\pytz-2021.1-py2.py3-none-any.whl Saved e:\python\packages\pywin32-300-cp38-cp38-win_amd64.whl Saved e:\python\packages\pywin32_ctypes-0.2.0-py2.py3-none-any.whl Saved e:\python\packages\pywinpty-0.5.7-cp38-cp38-win_amd64.whl Saved e:\python\packages\pyzmq-22.0.3-cp38-cp38-win_amd64.whl Saved e:\python\packages\qtconsole-5.0.3-py3-none-any.whl Saved e:\python\packages\qtpy-1.9.0-py2.py3-none-any.whl Saved e:\python\packages\reedsolo-1.5.4.tar.gz Saved e:\python\packages\scipy-1.6.1-cp38-cp38-win_amd64.whl Saved e:\python\packages\seaborn-0.11.1-py3-none-any.whl Saved e:\python\packages\send2trash-1.5.0-py3-none-any.whl Saved e:\python\packages\six-1.15.0-py2.py3-none-any.whl Saved e:\python\packages\terminado-0.9.3-py3-none-any.whl Saved e:\python\packages\testpath-0.4.4-py2.py3-none-any.whl Saved e:\python\packages\tornado-6.1-cp38-cp38-win_amd64.whl Saved e:\python\packages\traitlets-5.0.5-py3-none-any.whl Saved e:\python\packages\wcwidth-0.2.5-py2.py3-none-any.whl Saved e:\python\packages\webencodings-0.5.1-py2.py3-none-any.whl Saved e:\python\packages\widgetsnbextension-3.5.1-py2.py3-none-any.whl Saved e:\python\packages\setuptools-54.1.2-py3-none-any.whl Successfully downloaded et-xmlfile-2021 openpyxl Pillow PyMsgBox PyMySQL altgrap h anaconda argon2-cffi async-generator attrs backcall bitstring bleach cffi colo rama cryptography cycler decorator defusedxml ecdsa entrypoints esptool et-xmlfi le future ipykernel ipython ipython-genutils ipywidgets jedi Jinja2 jsonschema j upyter jupyter-client jupyter-console jupyter-core jupyterlab-pygments jupyterla b-widgets kiwisolver MarkupSafe matplotlib mistune MouseInfo nbclient nbconvert nbformat nest-asyncio notebook numpy packaging pandas pandocfilters parso pefile pickleshare prometheus-client prompt-toolkit PyAutoGUI PyBrain pycparser PyGetW indow Pygments pyinstaller pyinstaller-hooks-contrib pyparsing pyperclip PyRect pyrsistent PyScreeze pyserial python-dateutil PyTweening pytz pywin32 pywin32-ct ypes pywinpty pyzmq qtconsole QtPy reedsolo scipy seaborn Send2Trash six termina do testpath tornado traitlets wcwidth webencodings widgetsnbextension setuptools E:\Python>
安装离线包
离线安装时,把压缩包拷贝到离线电脑的某个分区根目录下,解压后运行以下DOS命令:
python -m pip install pip-21.0.1-py3-none-any.whl pip install --no-index --find-links=e:\packages -r e:\packages\PackageList.txt
注意命令行中的空格: ┗┛ 表空格符,及两个参数:--no-index --find-links
pip ┗┛ install ┗┛ --no-index ┗┛ --find-links=e:\packages ┗┛ -r ┗┛ e:\packages\PackageList.txt
经本人实测,安装结束时与原电脑的 pip list 列表完全相同。
离线包下载地址
离线包: Packages.rar (文件大小:99.6M)
Packages.rar-Python文档类资源-CSDN下载
如果您刚好有本站的积分/C币可以点击上述网址下载已经制作好的离线安装包,谢谢!
其中 PackageList.txt 中带 @ file:///E:Python/...... 需要改写成 == 版本号
altgraph==0.17 anaconda==0.0.1.1 argon2-cffi==20.1.0 async-generator==1.10 attrs==20.3.0 backcall==0.2.0 bitstring==3.1.7 bleach==3.3.0 cffi==1.14.5 colorama==0.4.4 cryptography==3.4.6 cycler==0.10.0 decorator==4.4.2 defusedxml==0.7.1 ecdsa==0.16.1 entrypoints==0.3 esptool==3.0 et-xmlfile==1.0.1 et-xmlfile-2021 @ file:///E:/Python/et_xmlfile_2021-1.0.2-py3-none-any.whl future==0.18.2 ipykernel==5.5.0 ipython==7.21.0 ipython-genutils==0.2.0 ipywidgets==7.6.3 jedi==0.18.0 Jinja2==2.11.3 jsonschema==3.2.0 jupyter==1.0.0 jupyter-client==6.1.12 jupyter-console==6.3.0 jupyter-core==4.7.1 jupyterlab-pygments==0.1.2 jupyterlab-widgets==1.0.0 kiwisolver==1.3.1 MarkupSafe==1.1.1 matplotlib==3.3.4 mistune==0.8.4 MouseInfo==0.1.3 nbclient==0.5.3 nbconvert==6.0.7 nbformat==5.1.2 nest-asyncio==1.5.1 notebook==6.2.0 numpy==1.20.1 openpyxl @ file:///E:/Python/openpyxl-3.0.7-py2.py3-none-any.whl packaging==20.9 pandas==1.2.3 pandocfilters==1.4.3 parso==0.8.1 pefile==2019.4.18 pickleshare==0.7.5 Pillow @ file:///E:/Python/Pillow-8.1.2-cp38-cp38-win_amd64.whl prometheus-client==0.9.0 prompt-toolkit==3.0.17 PyAutoGUI==0.9.52 PyBrain==0.3 pycparser==2.20 PyGetWindow==0.0.9 Pygments==2.8.1 pyinstaller==4.2 pyinstaller-hooks-contrib==2021.1 PyMsgBox @ file:///E:/Python/PyMsgBox-1.0.9-py3-none-any.whl PyMySQL @ file:///E:/Python/pymysql-1.0.2-py3-none-any.whl pyparsing==2.4.7 pyperclip==1.8.2 PyRect==0.1.4 pyrsistent==0.17.3 PyScreeze==0.1.26 pyserial==3.5 python-dateutil==2.8.1 PyTweening==1.0.3 pytz==2021.1 pywin32==300 pywin32-ctypes==0.2.0 pywinpty==0.5.7 pyzmq==22.0.3 qtconsole==5.0.3 QtPy==1.9.0 reedsolo==1.5.4 scipy==1.6.1 seaborn==0.11.1 Send2Trash==1.5.0 six==1.15.0 terminado==0.9.3 testpath==0.4.4 tornado==6.1 traitlets==5.0.5 wcwidth==0.2.5 webencodings==0.5.1 widgetsnbextension==3.5.1
也可以复制下面代码框里的文本,保存并替代原来的 PackageList.txt 文件, 再用引用框里的命令安装。
E:\>pip install --no-index --find-links=e:\packages -r e:\packages\PackageList.txt
E:\>pip freeze # 安装完成后执行此命令就得到以下清单。还可以重定向到文本文件: pip freeze > list.txt
pip==21.0.1 altgraph==0.17 anaconda==0.0.1.1 argon2-cffi==20.1.0 async-generator==1.10 attrs==20.3.0 backcall==0.2.0 bitstring==3.1.7 bleach==3.3.0 cffi==1.14.5 colorama==0.4.4 cryptography==3.4.6 cycler==0.10.0 decorator==4.4.2 defusedxml==0.7.1 ecdsa==0.16.1 entrypoints==0.3 esptool==3.0 et-xmlfile==1.0.1 et-xmlfile-2021==1.0.2 future==0.18.2 ipykernel==5.5.0 ipython==7.21.0 ipython-genutils==0.2.0 ipywidgets==7.6.3 jedi==0.18.0 Jinja2==2.11.3 jsonschema==3.2.0 jupyter==1.0.0 jupyter-client==6.1.12 jupyter-console==6.3.0 jupyter-core==4.7.1 jupyterlab-pygments==0.1.2 jupyterlab-widgets==1.0.0 kiwisolver==1.3.1 MarkupSafe==1.1.1 matplotlib==3.3.4 mistune==0.8.4 mouseinfo==0.1.3 nbclient==0.5.3 nbconvert==6.0.7 nbformat==5.1.2 nest-asyncio==1.5.1 notebook==6.2.0 numpy==1.20.1 openpyxl==3.0.7 packaging==20.9 pandas==1.2.3 pandocfilters==1.4.3 parso==0.8.1 pefile==2019.4.18 pickleshare==0.7.5 pillow==8.1.2 prometheus-client==0.9.0 prompt-toolkit==3.0.17 pyautogui==0.9.52 PyBrain==0.3 pycparser==2.20 pygetwindow==0.0.9 Pygments==2.8.1 pyinstaller==4.2 pyinstaller-hooks-contrib==2021.1 pymsgbox==1.0.9 PyMySQL==1.0.2 pyparsing==2.4.7 pyperclip==1.8.2 pyrect==0.1.4 pyrsistent==0.17.3 pyscreeze==0.1.26 pyserial==3.5 python-dateutil==2.8.1 pytweening==1.0.3 pytz==2021.1 pywin32==225 pywin32-ctypes==0.2.0 pywinpty==0.5.7 pyzmq==22.0.3 qtconsole==5.0.3 QtPy==1.9.0 reedsolo==1.5.4 scipy==1.6.1 seaborn==0.11.1 Send2Trash==1.5.0 six==1.15.0 terminado==0.9.3 testpath==0.4.4 tornado==6.1 traitlets==5.0.5 wcwidth==0.2.5 webencodings==0.5.1 widgetsnbextension==3.5.1
小批量安装
import os libs=['numpy','matplotlib','pillow','requests','sympy','pandas','pygame'] for lib in libs: try: os.system('pip install '+lib) print(lib+' installed successfully!') except: print(lib+' installation failed!')