Python不会在git bash(Windows)中运行.当我在命令行中键入python时,它将我带到一个空白行,而不是说它已经像在Powershell中那样输入了python 2.7.10.它没有给我一个错误消息,但python只是不运行.
我已经确定了PATH中的环境变量c:\python27.我还能检查什么?
发生此问题的会话如下所示:
user@hostname MINGW64 ~
$ type python
python is /c/Python27/python
user@hostname MINGW64 ~
$ python
Run Code Online (Sandbox Code Playgroud)
......坐在那里而不回到提示.
今天当我尝试在 Sublime Text 3 上运行一个简单的代码时,出现了以下消息:
未找到 Python,但可以从 Microsoft Store 安装:https : //go.microsoft.com/fwlink?linkID=2082640
当我在 CMD 中输入 Python 时,它会打开 Windows 应用商店让我下载 Python 3.7。今天无缘无故出现这个问题,我没有更改或下载有关Python的任何内容,并且已经尝试重新安装Python,并且路径是正确的。
我错误地检入(到 github)一些敏感文件。为了解决这个问题,我按照这里的说明运行了命令:
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch settings.json" --prune-empty --tag-name-filter cat -- --all
echo "settings.json" >> .gitignore
git add .gitignore
git commit -m "Add settings.json to .gitignore"
git push origin --force --all
git push origin --force --tags
git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
Run Code Online (Sandbox Code Playgroud)
但是,我可以转到我的提交历史记录以查看已删除的文件。
要解决此问题,如何从 github 提交历史记录中删除该文件?
我正在尝试在我的~/.bashrc文件中为 Python 指定别名。我输入此命令是为了告诉 Git Bash 在哪里可以找到 Python 可执行文件:
python --version winpty
Run Code Online (Sandbox Code Playgroud)
...从我的 [Git Bash] 中,不幸的是,我收到此错误:
MINGW64 ~
$ python --version
winpty: error: cannot start '"C:/Program Files/WindowsApps/Microsoft.DesktopAppInstaller_1.4.3161.0_x64__8wekyb3d8bbwe/AppInstallerPythonRedirector.exe" --version': Access is denied. (error 0x5)
Run Code Online (Sandbox Code Playgroud)
我应该如何从 [Git Bash] 正确运行 python?
谢谢。
我在 Windows 10 上安装了 Ubuntu 应用程序,我想将其用作 VS Code 中的终端。我看到 VS Code 自动检测 Git Bash、PowerShell、Cmd.exe 等选项,并提供将它们用作终端的选项。但我想使用Ubuntu。是否可以?
Python 新手。python --version在我的 GitBash上执行 a时出现以下错误。...Appdata/Local/Microsoft/WindowsApps/python3:权限被拒绝
根据这个论坛上的一些答案,我关闭了 python 的应用程序执行别名。这样做从我的 Windows 应用程序文件夹中删除了两个“存根”python.exe 和 python3.exe,并导致另一个错误 No such file or directory to my python --version on GitBash。
我是 python 的新手,所以被卡在安装本身上很烦人。我在这里错过了什么???
现在是 12 月,我认为微软的所有这些更新仍然没有解决这个问题。或者?
当我在 Windows 上运行它时,所有命令都可以正常工作PowerShell。
起初,我无法gcloud从.sh脚本文件或 Git Bash 终端运行任何命令。
好像git bash没找到SDKPython自带的捆绑安装gcloud。
所以我也为 Windows 安装了 Python。
现在我可以从PowerShell,.sh file和Git bash.
从PowerShell,我得到一个干净的日志,如下所示:
但是从我从.sh脚本文件或从Git bash窗口运行它。这被记录:
这似乎是工作的罚款,但这个Permission Denied错误的WindowsApps/python3。
我怎样才能摆脱它?
git-bash ×4
python ×4
git ×2
windows ×2
windows-10 ×2
anaconda3 ×1
bash ×1
command-line ×1
gcloud ×1
github ×1
powershell ×1
python-3.x ×1
sublimetext3 ×1
ubuntu ×1