康达:创建虚拟环境 [英] Conda: Creating a virtual environment

查看:500
本文介绍了康达:创建虚拟环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个虚拟的环境.我已经按照来自康达.

I'm trying to create a virtual environment. I've followed steps from both Conda and Medium.

一切工作正常,直到我需要采购新的环境.

Everything works fine until I need to source the new environment.

conda info -e

# conda environments:
#
base                  *  /Users/fwrenn/anaconda3
test_env                 /Users/fwrenn/anaconda3/envs/test_env

source ~/anaconda3/bin/activate test_env
_CONDA_ROOT=/Users/fwrenn/anaconda3: Command not found.
Badly placed ()'s.

我无法找出问题.这里搜索上有解决方案,说行添加到您的.bash_profile,但我不是在bash工作,只有CSH.它看起来就像是无法建立在的目录路径.

I can't figure out the problem. Searching on here has solutions that say adding lines to your bash_profile, but I don't work in bash, only csh. It LOOKS like it's unable to build the directory path in activate.

我的个人资料:

OSX
python --version
Python 3.6.3 :: Anaconda custom (64-bit)
conda --version
conda 4.4.7

推荐答案

我能够解决我的问题.执行source activate test_env命令没有拿起我的.bash_profile,我通常在tcsh中工作.只需在开始<4>的子进程是足以让工作.我想我假设,错误地认为在命令将开始在<4>和使用<4>环境变量.

I was able to solve my problem. Executing the source activate test_env command wasn't picking up my .bash_profile, I normally work in tcsh. Simply starting a subprocess in bash was enough to get activate working. I guess I assumed, incorrectly, that the activate command would start a child process in bash and use bash environment variables.

> conda info -e
> # conda environments:
> #
> base                  *  ~/anaconda3
> test_env                 ~/anaconda3/envs/test_env
> bash
~$ source ~/anaconda3/bin/activate test_env
(test_env) ~$
(test_env) ~$ conda info -e
# conda environments:
#
test_env              *  ~/anaconda3/envs/test_env
root                     ~/anaconda3

这篇关于康达:创建虚拟环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆