pythonbackupanacondacondainstall.packages

How to backup Anaconda added packages?


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.


Solution

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

    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