Windows 10: /usr/bin/env: 'python3': 没有那个文件或目录。

3
在Windows 10下,我收到了以下信息:
/usr/bin/env: ‘python3’: No such file or directory

在gitbash中,当尝试执行例如bpmake命令时。
Python已添加到PATH(版本3.8)。
配置中漏掉了什么?

bash: whereis: 命令未找到 // 尝试找出 "whereis" 的依赖关系 - undefined
1
据我所知,/usr/bin/env不是Windows命令。你试图运行的脚本似乎是针对类Unix操作系统定制的。 - undefined
假设git-bash有一个总体标准的设置(除了缺少whereis命令):你是如何安装Python 3的? - undefined
仍然:如何?在git-bash中执行,还是在Windows中运行可执行文件? - undefined
1
或者,考虑使用Windows Subsystem for Linux (WSL),如果你需要类似Unix的行为。或者,完全按照Windows的风格进行操作(即不使用git-bash,而是使用Windows命令提示符或类似工具,并进行Windows-style的PATH设置)。 - undefined
显示剩余6条评论
1个回答

5

Windows 10: 我在 python38 的旁边安装了 python39。由于系统混乱,我卸载了 python39。python3 被停止使用。

因此,我将 C:\Python38\ 中的 python.exe 复制到 python3.exe 作为解决方法。 不是最好的选择,但也不是糟糕的选择。

在 git-bash 中输出 python3 的位置:

$ where python3
C:\Python38\python3.exe

$ /usr/bin/env python3
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接