问题描述
我发现,当我创建Conda环境source activate environment
然后停用该环境source deactivate environment
时,我的本机bash命令不再起作用.
I am finding that when I create a Conda environment source activate environment
and then deactivate that environment source deactivate environment
, my native bash commands no longer work.
我在启用环境之前附加了ls工作的映像,然后在之后未附加.我认为这是由于我的PATH引起的-但是我是新手,不确定具体要解决什么.我正在Windows的Git Bash中执行此操作. Anaconda 3和Python 3.5.
I've attached an image of ls working before enabling an environment and then not afterwards. I assume that this is something because of my PATH - but I am a novice and am not sure specifically what to fix. I am doing this in Git Bash on Windows. Anaconda 3 and Python 3.5.
推荐答案
您的conda环境很可能正在替换本地bash配置文件中定义的参数和环境变量.我敢肯定,如果您打开一个新的环境(bash会话),您会发现一切正常.
Most probably your conda environment is replacing the parameters and environment variables defined in your local bash profile. I am sure if you open a new environment(bash session), you will find everything is working fine.
我建议您在停用环境后添加一条命令以重新加载bash概要文件,以便再次应用概要文件变量值.它应该可以解决问题.
I would suggest you add a command to reload bash profile after deactivating the environment, so that the profile variable values will again be applied. It should solve the problem.
这篇关于Conda激活/停用破坏环境的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!