首页 > 解决方案 > git bash 无法读取我的 python 文件已经尝试过类似问题下的方法

问题描述

我的 python 文件的位置在我的电脑中 -User -App data - Roaming -Microsoft-Windows-Start Menu-Python 3.8.我通过添加"C:\Python38"到系统变量下的路径来尝试该方法。但是当我输入时python --version,它会返回bash: python no command found;我还尝试输入“Git bash 不会运行我的 python 文件”问题的答案中推荐的 Path 命令,但仍然没有。如果有帮助,我会使用在 Mac 上下载的 Windows 系统。

标签: pythonbashgitcommand

解决方案


在 git bash 中使用别名

alias python='/c/Python3.8/...'

然后关闭并重新打开 bash 窗口,它应该可以工作。


推荐阅读