【问题标题】:Windows 10: /usr/bin/env: ‘python3’: No such file or directoryWindows 10:/usr/bin/env:'python3':没有这样的文件或目录
【发布时间】:2020-04-30 06:28:40
【问题描述】:

在 windows 10 下,我正在接收

/usr/bin/env: ‘python3’: No such file or directory

在 gitbash 中,当尝试执行例如 bpmake 命令时。

Python 添加到 PATH(3.8 版)

配置中遗漏了什么?

【问题讨论】:

  • whereis python3 的结果是什么?
  • bash: whereis: command not found // 试图找出“whereis”的依赖关系
  • /usr/bin/env 据我所知不是 Windows 命令。您尝试运行的脚本似乎是为类似 unix 的操作系统量身定制的。
  • 假设 git-bash 具有整体标准设置(除了缺少 whereis):您是如何安装 Python 3 的?
  • 或者,如果您需要类似 unix 的行为,请考虑使用适用于 Linux 的 Windows 子系统 (WSL)。 或者,做所有 Windows 风格的事情(也就是说,不使用 git-bash,而是使用 Windows 命令提示符或类似的;以及 Windows 风格的 PATH 设置)。

标签: python windows-10 git-bash


【解决方案1】:

Windows 10:我在 python38 旁边安装了 python39。由于系统上的杂乱无章,我卸载了 python39。 python3停止工作。

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

python3 在 git-bash 中的输出:

$ 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.
>>>

【讨论】:

    猜你喜欢
    • 2019-12-11
    • 1970-01-01
    • 2016-02-20
    • 1970-01-01
    • 2011-04-08
    • 2013-03-11
    • 2013-02-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多