如何在Windows 10中备份anaconda环境? [英] How to back up anaconda environment in Windows 10?
问题描述
最近,由于某些不良的conda软件包升级,我的anaconda环境被破坏了.基于这种经验,我想备份anaconda环境,以便将来轻松恢复.
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.
我要做的备份是将整个文件夹压缩到C:\ProgramData\Anaconda3
.这是正确的方法吗?
What I did to back up was to zip up the entire folder at C:\ProgramData\Anaconda3
. Is this the correct way?
我正在使用Windows 10,anaconda python v3.6 64位.
I am using Windows 10, anaconda python v3.6 64-bit.
推荐答案
出于备份目的压缩conda
环境实际上没有任何意义,因为还有其他方法可能更合适并且使用为此目的而设计的内置函数.
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.
您可以创建conda
环境的.txt
版本,其中详细介绍了其中的每个模块和版本,然后可以在以后用于重新创建 EXACT 环境.
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
有关管理
NB 另外,conda环境目录可能相当大(通常> 1GB),而此处创建的txt
文件约为25KB,在为安全起见而对某些内容进行归档时具有明显的优势.保持.
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.
这篇关于如何在Windows 10中备份anaconda环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!