How to back up anaconda environment in Windows 10?

那年仲夏 提交于 2019-12-12 13:04:23

问题


Recently, my anaconda environment got broken due to certain bad conda package upgrade. Due to this back experience, I would like to back up my anaconda environment for future easy recovery.

What I did to back up was to zip up the entire folder at C:\ProgramData\Anaconda3. Is this the correct way?

I am using Windows 10, anaconda python v3.6 64-bit.


回答1:


It doesn't really make sense to zip up a conda environment for back up purposes since there are other ways to do this which may be more appropriate and use the in-built functions designed to do just this.

You can create a .txt version of the conda environment that details each module and version within, and can then be used to re-create the EXACT environment in the future.

# Create list of the environment
conda list --explicit environment_backup.txt

# Use the newly created text file to recreate the environment
conda create --name my_env_name --file environment_backup.txt

See docs for more information on managing conda environments.

N.B. As an additional point, conda environment directories can be fairly large (often >1GB) whereas the txt file created here is ~25KB, offering a clear advantage when archiving something for safe-keeping.



来源:https://stackoverflow.com/questions/52123749/how-to-back-up-anaconda-environment-in-windows-10

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