python+pip配置

1、安装python3.6
2、配置pip
C:\Users\l00399335\pip\pip.ini

[global]
timeout = 60
trusted-host = mirrors.tools.huawei.com
index-url = http://mirrors.tools.huawei.com/pypi/simple/

升级pip

D:\>D:\python36vm\Scripts\python.exe -m pip install --upgrade pip

3、安装虚拟机

python –m venv d:/python36vm/

4、安装插件
D:>D:\python36vm\Scripts\pip3.exe install -r pip.txt
pip.txt内容:
里面不能有pip和setuptools,避免先删除了老的pip,导致失败。

APScheduler==3.2.0
argh==0.24.1
asn1crypto==0.21.0
Babel==2.5.3
backports.zoneinfo==0.2.1
bcrypt==3.1.3
certifi==2018.8.24
cffi==1.10.0
chardet==3.0.4
Click==7.0
cryptography==2.5
et-xmlfile==1.0.1
Flask==0.12.2
Flask-APScheduler==1.10.1
html5lib==1.1
idna==2.7
importlib-metadata==4.6.4
importlib-resources==5.4.0
itsdangerous==0.24
jdcal==1.4.1
Jinja2==2.10
jsonpath==0.75
lxml==4.1.0
MarkupSafe==1.0
numpy==1.19.5
openpyxl==2.6.2
pandas==0.22.0
paramiko==2.6.0
pathtools==0.1.2
pbr==5.6.0
Pillow==8.3.1
pycparser==2.19
PyMySQL==0.8.0
PyNaCl==1.5.0
python-dateutil==2.8.2
python-docx==0.8.6
pytz==2017.3
pytz-deprecation-shim==0.1.0.post0
PyYAML==3.10
rarfile==4.0
requests==2.19.1
selenium==3.141.0
six==1.11.0
stevedore==3.4.0
termcolor==1.1.0
typing-extensions==3.10.0.0
tzdata==2022.4
tzlocal==1.5.1
urllib3==1.23
watchdog==0.8.3
webencodings==0.5.1
Werkzeug==0.14.1
wheel==0.37.1
xlrd==2.0.1
zipp==3.5.0

该操作的执行过程:
1、会下载所有包到临时文件:
C:\Users\l00399335\AppData\Local\Temp\pip-build-ls8vcpxt
2、安装到pip3对应的python下:

Installing collected packages: zipp, pytz, pycparser, MarkupSafe, Werkzeug, tzlocal, typing-extensions, six, Jinja2, itsdangerous, importlib-resources, Click, cffi, asn1crypto, webencodings, urllib3, tzdata, PyYAML, python-dateutil, PyNaCl, pbr, pathtools, numpy, lxml, jdcal, importlib-metadata, idna, Flask, et-xmlfile, cryptography, chardet, certifi, bcrypt, backports.zoneinfo, argh, APScheduler, xlrd, wheel, watchdog, termcolor, stevedore, selenium, requests, rarfile, pytz-deprecation-shim, python-docx, PyMySQL, Pillow, paramiko, pandas, openpyxl, jsonpath, html5lib, Flask-APScheduler, Babel
    Running setup.py install for pycparser ... done
    Running setup.py install for MarkupSafe ... done
    Running setup.py install for tzlocal ... done
    Running setup.py install for itsdangerous ... done
    Running setup.py install for PyYAML ... done
    Running setup.py install for pathtools ... done
    Running setup.py install for et-xmlfile ... done
    Running setup.py install for argh ... done
    Running setup.py install for watchdog ... done
    Running setup.py install for termcolor ... done
    Running setup.py install for python-docx ... done
    Running setup.py install for openpyxl ... done
    Running setup.py install for jsonpath ... done
    Running setup.py install for Flask-APScheduler ... done
Successfully installed APScheduler-3.2.0 Babel-2.5.3 Click-7.0 Flask-0.12.2 Flask-APScheduler-1.10.1 Jinja2-2.10 MarkupSafe-1.0 Pillow-8.3.1 PyMySQL-0.8.0 PyNaCl-1.5.0 PyYAML-3.10 Werkzeug-0.14.1 argh-0.24.1 asn1crypto-0.21.0 backports.zoneinfo-0.2.1 bcrypt-3.1.3 certifi-2018.8.24 cffi-1.10.0 chardet-3.0.4 cryptography-2.5 et-xmlfile-1.0.1 html5lib-1.1 idna-2.7 importlib-metadata-4.6.4 importlib-resources-5.4.0 itsdangerous-0.24 jdcal-1.4.1 jsonpath-0.75 lxml-4.1.0 numpy-1.19.5 openpyxl-2.6.2 pandas-0.22.0 paramiko-2.6.0 pathtools-0.1.2 pbr-5.6.0 pycparser-2.19 python-dateutil-2.8.2 python-docx-0.8.6 pytz-2017.3 pytz-deprecation-shim-0.1.0.post0 rarfile-4.0 requests-2.19.1 selenium-3.141.0 six-1.11.0 stevedore-3.4.0 termcolor-1.1.0 typing-extensions-3.10.0.0 tzdata-2022.4 tzlocal-1.5.1 urllib3-1.23 watchdog-0.8.3 webencodings-0.5.1 wheel-0.37.1 xlrd-2.0.1 zipp-3.5.0

备注:

Using legacy 'setup.py install' for argh, since package 'wheel' is not insta
报错信息提示你正在使用传统的setup.py install方式安装argh包,但由于wheel包未安装,所以无法使用新的wheel包安装方式。wheel是一个Python包,它提供了一种更高效的打包格式,可以快速安装不需要编译或设置的Python包。

解决方法:

安装wheel包:

pip install wheel

安装argh包:

pip install argh

这样,pip会使用wheel包进行安装,这通常会更快,也可以避免一些与传统安装相关的问题。如果你已经有了argh的源码,可以直接使用setup.py进行安装,但在安装之前确保先安装了wheel。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容