我想通过在Git Bash中输入“ conda activate”来激活conda环境,并收到CommandNotFoundError消息,其中包含有关如何启用conda的信息。我尝试遵循给出的信息,但是这对我来说效果不佳,并且每次启动时,我都会在Git Bash中显示一堆旧输出。除此之外,它似乎运行良好。后来我也学会了使用“源代码激活”来激活环境。尝试在删除Git目录后重新安装Git Bash,但这没有用。
Conda版本4.5.10。
如何清除开始时输出的输出?
这是我每次运行Git Bash时看到的内容:
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
bash: C:ProgramDataAnaconda3etcprofile.dconda.sh: No such file or directory
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If your shell is Bash or a Bourne variant, enable conda for the current user wit h
$ echo ". C:\ProgramData\Anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc
or, for all users, enable conda with
$ sudo ln -s C:\ProgramData\Anaconda3/etc/profile.d/conda.sh /etc/profile.d/ conda.sh
The options above will permanently enable the 'conda' command, but they do NOT
put conda's base (root) environment on PATH. To do so, run
$ conda activate
in your terminal, or to put the base environment on PATH permanently, run
$ echo "conda activate" >> ~/.bashrc
Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
your ~/.bashrc file. You should manually remove the line that looks like
export PATH="C:\ProgramData\Anaconda3/bin:$PATH"
^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If your shell is Bash or a Bourne variant, enable conda for the current user wit h
$ echo ". C:\ProgramData\Anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc
or, for all users, enable conda with
$ sudo ln -s C:\ProgramData\Anaconda3/etc/profile.d/conda.sh /etc/profile.d/ conda.sh
The options above will permanently enable the 'conda' command, but they do NOT
put conda's base (root) environment on PATH. To do so, run
$ conda activate
in your terminal, or to put the base environment on PATH permanently, run
$ echo "conda activate" >> ~/.bashrc
Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
your ~/.bashrc file. You should manually remove the line that looks like
export PATH="C:\ProgramData\Anaconda3/bin:$PATH"
^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^
bash: C:ProgramDataAnaconda3/etc/profile.d/conda.sh: No such file or directory
DELL@DELL MINGW64 /
$
答案 0 :(得分:1)
输出由.bashrc
中的文件生成。
在主目录(只需键入cd
)中查找“隐藏”文件.bashrc
(不是真正的隐藏文件,ls
将在您使用选项{{1 }})。
在该文件中,您可能会有C:\ ProgramData \ Anaconda3 / etc / profile.d / conda.sh这样的行。将-a
替换为\
(或替换为/
)或删除整行。
Windows理解正斜杠。