电脑重装后 python 2 3快速安装

背景:

电脑重装后,python也要跟着重装,将安装包、环境变量备份等安装完成后直接安装

重装前

1. pip包备份,命令窗口

1 pip freeze > py2.txt #python2的包
2 pip3 freeze > py3.txt #python3的包

2.环境变量备份,命令窗口

1 set >> D:\env.txt

重装后

1.安装python2、3

 安装包可以从官网下载,也可以使用网盘中的文件

链接:https://pan.baidu.com/s/1sqejXeezFzU_2XJJtzD_Hw 
提取码:f0q3

2.将python3目录下的 python.exe 复制一份,修改成 python3.exe

3.将重装前2中的环境变量中的 python路径加到 环境变量中

C:\Python27;
C:\Python27\Scripts;
C:\Python27\Lib\site-packages;
C:\Python37;
C:\Python37\Scripts;

4.安装VCForPython27 包,不安装的话 第五步会报错 error: Microsoft Visual C++ 9.0 is required

地址:http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

直接下载安装 或从重装后步骤1中的网盘中下载

5.安装包

1 pip install -r py2.txt #安装python2的包
2 pip install -r py3.txt #安装python3的包

附录:

自己常用安装包

Python2

alembic==0.8.7
aniso8601==6.0.0
Appium-Python-Client==0.28
AppMetrics==0.5.0
APScheduler==3.6.1
arrow==0.13.1
asn1crypto==0.24.0
backports-abc==0.5
backports.functools-lru-cache==1.5
bcrypt==3.1.4
beautifulsoup4==4.6.0
binaryornot==0.4.4
blinker==1.4
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
click==6.6
configparser==3.7.4
cookiecutter==1.6.0
cookiejar==0.0.2
coverage==4.5.1
cryptography==2.2.2
cycler==0.10.0
decorator==4.3.0
Django==1.11.20
docutils==0.14
dominate==2.3.5
enum34==1.1.6
et-xmlfile==1.0.1
Flask==0.11.1
Flask-Bootstrap==3.3.7.1
Flask-HTTPAuth==3.1.2
Flask-JWT==0.3.2
Flask-Login==0.4.1
Flask-Mail==0.9.1
Flask-Migrate==2.0.0
Flask-Moment==0.7.0
Flask-RESTful==0.3.7
Flask-Script==2.0.5
Flask-SQLAlchemy==2.1
funcsigs==1.0.2
future==0.17.1
futures==3.2.0
hiredis==0.2.0
http==0.2
idna==2.6
ipaddress==1.0.22
itsdangerous==0.24
jdcal==1.4
jieba==0.39
Jinja2==2.8
jinja2-time==0.2.0
jsonpatch==1.23
jsonpointer==2.0
jwt==0.5.4
kitchen==1.2.5
kiwisolver==1.1.0
livetest==0.5
Mako==1.0.4
MarkupSafe==0.23
matplotlib==2.2.4
mock==2.0.0
mysql-connector==2.2.9
MySQL-python==1.2.5
numpy==1.16.4
openpyxl==2.6.2
pager==3.3
paramiko==2.4.1
parse==1.8.4
passlib==1.7.1
payment==0.0.1.2
pbr==5.1.3
Pillow==6.0.0
pluggy==0.6.0
poyo==0.4.2
py==1.5.3
pyasn1==0.4.3
pycparser==2.18
pycrypto==2.6
PyJWT==1.4.2
pymongo==3.6.1
PyMySQL==0.7.6
PyNaCl==1.2.1
pyparsing==2.4.0
python-dateutil==2.8.0
python-editor==1.0.1
pytz==2018.9
redis==2.10.5
redis-py-cluster==1.3.4
requests==2.19.0
robotframework==3.0.4
robotframework-appiumlibrary==1.4.6
robotframework-archivelibrary==0.4.0
robotframework-databaselibrary==1.0.1
robotframework-ftplibrary==1.6
robotframework-httplibrary==0.4.2
robotframework-mongodblibrary==0.3.4
robotframework-redislibrary==0.1
robotframework-requests==0.4.7
robotframework-ride==1.5.2.1
robotframework-selenium2library==3.0.0
robotframework-seleniumlibrary==3.1.1
robotframework-sshlibrary==3.0.0
schedule==0.6.0
selenium==3.12.0
singledispatch==3.4.0.3
six==1.11.0
SQLAlchemy==1.0.14
tornado==5.1.1
tox==3.0.0
typing==3.5.3.0
tzlocal==2.0.0
urllib3==1.23
virtualenv==16.0.0
visitor==0.1.3
waitress==1.1.0
webob==1.8.2
webtest==2.0.29
Werkzeug==0.11.10
whichcraft==0.5.2
wordcloud==1.5.0
WTForms==2.2.1

Python3

APScheduler==3.6.0
arrow==0.15.4
asn1crypto==0.24.0
Babel==2.7.0
backports.ssl-match-hostname==3.7.0.1
bcrypt==3.1.6
blinker==1.4
certifi==2019.3.9
cffi==1.12.3
chardet==3.0.4
Click==7.0
crcmod==1.7
cryptography==2.6.1
docker==3.7.2
docker-pycreds==0.4.0
Flask==1.0.2
Flask-Babel==0.12.2
Flask-Excel==0.0.7
Flask-Login==0.4.1
Flask-Mail==0.9.1
Flask-OAuthlib==0.9.5
Flask-Script==2.0.6
Flask-Session==0.3.1
Flask-SQLAlchemy==2.4.0
Flask-WTF==0.14.2
geoip2==2.9.0
gevent==1.4.0
greenlet==0.4.15
has==0.0.4
idna==2.8
ipaddress==1.0.22
itsdangerous==1.1.0
Jinja2==2.10.1
jmespath==0.9.4
lml==0.0.9
lxml==4.3.4
Markdown==2.6.11
MarkupSafe==1.1.1
maxminddb==1.4.1
oauthlib==2.1.0
olefile==0.46
packaging==19.0
paramiko==2.4.2
pip-review==1.0
pyasn1==0.4.5
pycparser==2.19
pyexcel==0.5.13
pyexcel-io==0.5.17
pyexcel-webio==0.1.4
PyMySQL==0.9.3
PyNaCl==1.3.0
pyparsing==2.4.0
pypiwin32==223
python-dateutil==2.8.1
pytz==2019.1
pywin32==224
requests==2.21.0
requests-oauthlib==1.1.0
robotframework==3.1.2
six==1.12.0
SQLAlchemy==1.3.6
texttable==1.6.1
tzlocal==1.5.1
urllib3==1.24.3
websocket-client==0.56.0
Werkzeug==0.15.2
WTForms==2.2.1
XMind==1.2.0
xmind2testcase==1.3.0