pip安装第三方包

1 python3环境已经安装好,且也配置到环境变量;这种方式是在线安装

注意不要将   pip list  安装了了,不然可能会覆盖自己已安装的这个包,不然导致其它包安装失败

首先,在已配置好的一台机器上,将需要的包导出到requirements.txt

>>>pip freeze > requirements.txt  报错时,可以用 如下命令然后将数据复制到文件,并用  pip  install -r file_name.txt  进行安装

查看requirements.txt,内容如下,可以按照如下格式添加自己需要的包;下面包含 python3 中 robotframework   安装的包

for i in range(100):
try:
os.system("pip install -r requirements.txt")
except Exception as e:
print(e)

antlr4-python2-runtime==4.4.0
Appium-Python-Client==0.36
asn1crypto==0.24.0
attrs==19.3.0
Automat==20.2.0
bcrypt==3.1.6
beautifulsoup4==4.7.1
bs4==0.0.1
certifi==2019.3.9
cffi==1.12.3
chardet==3.0.4
Click==7.0
colorama==0.4.1
configparser==3.7.4
constantly==15.1.0
cryptography==2.7
cx-Oracle==7.1.0
decorator==4.4.0
Django==2.2.6
docutils==0.14
Flask==1.1.1
gevent==1.4.0
geventhttpclient-wheels==1.3.1.dev2
greenlet==0.4.15
hyperlink==19.0.0
idna==2.7
image==1.5.27
incremental==17.5.0
itsdangerous==1.1.0
JPype1==0.7.4
Js2Py==0.70
kitchen==1.2.5
locustio==0.13.0
lxml==4.3.3
MarkupSafe==1.1.1
msgpack-python==0.5.6
Naked==0.1.31
numpy==1.18.2
pandas==1.0.3
paramiko==2.4.2
Pillow==5.3.0
pyasn1==0.4.5
pycparser==2.19
pycryptodome==3.9.7
PyExecJS==1.5.1
pygame==1.9.6
Pygments==2.3.1
PyHamcrest==2.0.2
pyjsparser==2.7.1
pymongo==3.8.0
PyMySQL==0.9.3
PyNaCl==1.3.0
PyPubSub==3.3.0
python-dateutil==2.8.1
pytz==2019.3
pywin32==224
PyYAML==5.3.1
pyzmq==18.1.1
qrcode==6.1
requests==2.20.0
robotframework==3.0.2
robotframework-appiumlibrary==1.5.0.3
robotframework-requests==0.5.0
robotframework-ride==1.7.4.2
robotframework-selenium2library==3.0.0
robotframework-seleniumlibrary==3.3.1
robotframework-sshlibrary==3.4.0
robotframeworklexer==1.1
scp==0.13.2
selenium==3.141.0
setuptools==39.0.1
shellescape==3.8.1
six==1.12.0
soupsieve==1.9.1
sqlparse==0.3.0
tee==0.0.3
Twisted==20.3.0
tzlocal==2.1
urllib3==1.24.2
Werkzeug==0.16.0
wxPython==4.0.4
xlrd==1.2.0
xmltodict==0.12.0
zope.interface==5.1.0

原文地址:https://www.cnblogs.com/pythonwork/p/12885221.html