GitBash-如何在启动后去掉旧的输出?
我想通过在Git Bash中输入“conda activate”来激活conda环境,并得到CommandNotFoundError消息,其中包含关于如何启用conda的信息。我试图按照给出的信息进行操作,但这对我来说效果不太好,每次启动Git Bash时,我都会看到一堆旧的输出。除此之外,它似乎运行良好。后来我还学会了使用“源激活”来激活环境。尝试在删除Git目录后重新安装Git Bash,但未成功 康达版本4.5.10 如何在开始时消除此输出打印输出 这是我每次运行Git Bash时看到的:GitBash-如何在启动后去掉旧的输出?,bash,git,Bash,Git,我想通过在Git Bash中输入“conda activate”来激活conda环境,并得到CommandNotFoundError消息,其中包含关于如何启用conda的信息。我试图按照给出的信息进行操作,但这对我来说效果不太好,每次启动Git Bash时,我都会看到一堆旧的输出。除此之外,它似乎运行良好。后来我还学会了使用“源激活”来激活环境。尝试在删除Git目录后重新安装Git Bash,但未成功 康达版本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 /
$
输出由
.bashrc
中的文件生成
在主目录(只需键入cd
)中查找“隐藏”文件。bashrc
(并非真正隐藏,ls
将在您使用选项-a
时显示该文件)。在该文件中,您可能有C:\ProgramData\Anaconda3/etc/profile.d/conda.sh这样的行。将
\
替换为/
(或\
)或删除整行。Windows理解正斜杠。您可以在主目录(只需键入
cd
)中查找“隐藏”文件。bashrc
(并非真正隐藏,ls
将在您使用选项-a
时显示该文件)。在该文件中,您可能有类似于C:\ProgramData\Anaconda3/etc/profile.d/conda.sh
的行。将`替换为“/”(或第
\``)或删除整行内容。非常感谢Walter a,他工作得很有魅力。然后我会将其作为回答再次发布感谢,因为我最终删除了整行内容。