Python pip通过requirements.txt 文件快速安装依赖

在现有环境导出requirements.txt

 pip freeze > requirements.txt

requirements.txt 内容:

avro==1.11.0
certifi==2021.10.8
charset-normalizer==2.0.12
crypto==1.4.1
future==0.18.2
idna==3.3
k3cloud-webapi-sdk==3.0.3
Naked==0.1.31
numpy==1.21.5
pandas==1.3.5
pycryptodome==3.14.1
python-dateutil==2.8.2
python-snappy==0.6.1
pytz==2022.1
PyYAML==6.0
requests==2.27.1
shellescape==3.8.1
six==1.16.0
typing_extensions==4.1.1
urllib3==1.26.9

在新环境导入requirements.txt安装依赖

pip install -r requirements.txt

安装完成后 pip list 查看:

pip list
Package            Version
------------------ ---------
avro               1.11.0
certifi            2021.10.8
charset-normalizer 2.0.12
crypto             1.4.1
future             0.18.2
idna               3.3
k3cloud-webapi-sdk 3.0.3
Naked              0.1.31
numpy              1.21.5
pandas             1.3.5
pip                22.0.4
pycryptodome       3.14.1
python-dateutil    2.8.2
python-snappy      0.6.1
pytz               2022.1
PyYAML             6.0
requests           2.27.1
setuptools         61.0.0
shellescape        3.8.1
six                1.16.0
typing_extensions  4.1.1
urllib3            1.26.9
wheel              0.37.1

你可能感兴趣的:(Python,python)