conda 导出依赖包并批量安装

 
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment


conda list -e > requirements.txt #Save all the info about packages to your folder


#To export environment file
activate <environment-name>
conda env export > <environment-name>.yml


#For other person to use the environment

conda env create -f <environment-name>.yml

#  Install via `conda` directly.
#  This will fail to install all
#  dependencies. If one fails,
#  all dependencies will fail to install.
#
conda install --yes --file requirements.txt


#
#  To go around issue above, one can
#  iterate over all lines in the
#  requirements.txt file.
#
while read requirement; do conda install --yes $requirement; done < requirements.txt

猜你喜欢

转载自blog.csdn.net/lwhsyit/article/details/80082328