康达:创建虚拟环境 [英] Conda: Creating a virtual environment
问题描述
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>的子进程是足以让
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屋!