Windows cmd git bash: conda.sh 没有那个文件或目录(Windows 行结尾,缺少斜杠)

Windows cmd git bash: conda.sh no such file or directory (Windows line endings, missing slashes)

我在 Windows 10 工作,全新安装了 Anaconda 和 Git Bash。我决定将 cmd.exe 设置为我的默认控制台程序以使用 git bash(而不是 minTTY),我想我已经遇到了 Unix 风格字符与 [=27= 的问题].

当我启动 cmd 时 Bash 告诉我找不到我的 conda.sh 文件:

bash: C:UsersjoshuAnaconda3/etc/profile.d/conda.sh: No such file or directory

首先,我的根目录 ("C:/Users/joshu/") 似乎 bash 缺少默认的 windows 斜杠。有谁知道如何解决这个问题?

谢谢

在 Windows 10/Git Bash/Anaconda 安装时遇到同样的问题。如果您在 Git Bash 中 运行 ~/.bashrc,它应该为您提供包含错误路径的 shell 脚本文件的位置。更正该文件中的路径后,重新启动终端时该消息应该会消失。

通过打开 ~/.bashrc 并更改 conda.sh 的位置来解决此问题,例如就我而言
. D:/Users/my_user/ProgramFile/Continuum/anaconda3/etc/profile.d/conda.sh

我有完全相同的问题。 运行 ~/.bashrc 在终端中。转到给定的路径并更正 conda.sh 路径。

在您的情况下,您会将 C:\Users\joshu\Anaconda3/etc/profile.d/conda.sh 替换为 C:/Users/joshu/Anaconda3/etc/profile.d/conda.sh 你唯一的问题是你的斜线设置错误。

另一件要检查的事情是确保 C:\Users 下的用户个人资料文件夹没有被隐藏。如果它已经隐藏,那么 C:\Anaconda\etc\profile.d\conda.sh 脚本 将找不到文件夹。