Anaconda从其他环境导入软件包 [英] Anaconda import packages from another environment
问题描述
我从另一台机器导入了anaconda环境.我想将导入环境中的软件包安装到根目录中,或者将导入环境设置为默认环境.有没有办法 1.将所有软件包从一个环境导入到另一个环境? 或者 2.使用非根环境作为默认环境吗?
I imported an anaconda environment from another machine. I want to install the packages from imported environment into root or make the imported environment as default. Is there any way to either 1. import all the packages from one environment to another? OR 2. Use non-root environment as default environment?
注意:两种环境都适用于python 2.7.
Note: both environments are for python 2.7.
推荐答案
首先从一台计算机导出环境:
First export the environment from one machine:
$ conda env export -n myenv -f myenv.yml
然后从另一台计算机上的myenv.yml
创建一个新环境:
Then create a new environment from myenv.yml
on the other machine:
$ conda env create -f myenv.yml
要默认使用此环境,请将source activate myenv
添加到.bashrc
.
To use this environment as default, add source activate myenv
to your .bashrc
.
这篇关于Anaconda从其他环境导入软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!