小编Wil*_*ill的帖子

在Python脚本中激活Conda环境

我正在将shell脚本转换为Python,我正在寻找一种在Python中以编程方式激活和停用conda环境的方法.我查看了Github上的Conda代码,但未能找到一个好的解决方案.

我需要激活环境,以便我可以在其中运行多个语句.例如:

source activate my_env
easy_install numpy 
backup_db
initialize_db
source deactivate 
Run Code Online (Sandbox Code Playgroud)

我没有使用子进程的运气.:-(

python bash subprocess anaconda conda

7
推荐指数
1
解决办法
2057
查看次数

标签 统计

anaconda ×1

bash ×1

conda ×1

python ×1

subprocess ×1