How to backup Anaconda added packages?

会有一股神秘感。 提交于 2019-12-21 03:02:42

问题


I have Anaconda for Python 2, It came packed with a lot of useful packages. During my work, I have added several packages to it using conda install command. Now I have to format my system, and I want to backup/pack all the added libraries, either as full packages or even by knowing the installation command of each one.

I searched StackOverflow, I found one unanswered question with a similar problem, the question suggested conda list -e >file_list.txt to create a file contains all the installed packages, but this is not sufficient for me, I want Anaconda to determine which package is added by me, and by which command, or to pack the added packages in full.

Thanks for help.


回答1:


I think you can find the solution you are looking for here.

  • Open the Anaconda prompt
  • Activate the environment you are interested in
  • Type conda env export > environment.yml

In the yml you will find all the dependencies and you can use it to create a new virtual environment as a copy of the current one.

For example, on the new/rebooted machine, you can do:

conda env create -f environment.yml


来源:https://stackoverflow.com/questions/44112457/how-to-backup-anaconda-added-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!