如何备份Anaconda添加的软件包? [英] How to backup Anaconda added packages?
问题描述
我有适用于Python 2的Anaconda,它随附了许多有用的软件包.在工作期间,我已使用conda install
命令向其中添加了几个软件包.现在,我必须格式化我的系统,我想备份/打包所有添加的库,要么是完整软件包,要么甚至是知道每个库的安装命令.
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.
我搜索了 StackOverflow ,我发现了一个
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.
感谢您的帮助.
推荐答案
I think you can find the solution you are looking for here.
- 打开Anaconda提示
- 激活您感兴趣的环境
- 键入
conda env export > environment.yml
在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
这篇关于如何备份Anaconda添加的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!