pip / conda 導出和安裝環境組件 requirements.txt


pip 批量導出包含環境中所有組件的requirements.txt文件

pip freeze > requirements.txt

pip 批量安裝requirements.txt文件中包含的組件依賴

pip install -r requirements.txt

pip 導出的requirements.txt文件格式

absl-py==0.2.0
astor==0.6.2
bleach==1.5.0
boto==2.48.0
boto==31.7.19
botocore==1.10.19
bz2file==0.98
certifi==2018.4.16
chardet==3.0.4
cycler==0.10.0
Cython==0.28.2
docutils==0.14
fasttext==0.8.3
future==0.16.0
gast==0.2.0
gensim==3.4.0
grpcio==1.11.0
h5py==2.7.1
html5lib==0.9999999

 

 

 

 

conda 批量導出包含環境中所有組件的requirements.txt文件

conda list -e > requirements.txt

conda 批量安裝requirements.txt文件中包含的組件依賴

conda install --yes --file requirements.txt    #這種執行方式,一遇到安裝不上就整體停止不會繼續下面的包安裝
FOR /F "delims=~" %f in (requirements.txt) DO conda install --yes "%f" #這個執行能解決上面出現的不執行后續包的問題

conda 導出的requirements.txt文件格式

# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file> # platform: win-64 absl-py=0.7.1=pypi_0 astor=0.7.1=pypi_0 certifi=2018.8.24=py35_1 gast=0.2.2=pypi_0 grpcio=1.19.0=pypi_0 h5py=2.9.0=pypi_0 keras-applications=1.0.7=pypi_0 keras-preprocessing=1.0.9=pypi_0 markdown=3.1=pypi_0 mock=2.0.0=pypi_0 numpy=1.16.2=pypi_0 pbr=5.1.3=pypi_0 pip=19.0.3=pypi_0 protobuf=3.7.1=pypi_0 python=3.5.6=he025d50_0 setuptools=40.2.0=py35_0 six=1.12.0=pypi_0 tensorboard=1.13.1=pypi_0 tensorflow=1.13.1=pypi_0 tensorflow-estimator=1.13.0=pypi_0 termcolor=1.1.0=pypi_0 vc=14.1=h0510ff6_4 vs2015_runtime=14.15.26706=h3a45250_0 werkzeug=0.15.1=pypi_0 wheel=0.31.1=py35_0 wincertstore=0.2=py35hfebbdb8_0

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM