gpt4 book ai didi

Python 未在 GitBash 上运行

转载 作者:太空宇宙 更新时间:2023-11-04 04:35:14 24 4
gpt4 key购买 nike

我刚进入一门介绍 Python 的类(class),所以我在我的 Windows 笔记本电脑上下载了 GitBash 和 Andaconda。我在 GitBash 上导航到我的 python 文件并尝试执行我的 python 文件,但无济于事。我在该网站上搜索了有关该做什么的答案,并尝试了尽可能多的解决方案,但我没有运气。我对此很菜鸟,所以我想我遗漏了一些明显的东西。也许只有一行代码可以拯救我?

...

TECH-TESTER+usd@Tech-tester MINGW64 ~/Desktop/Python-Essentials/PythonIntro
$ ls
python_intro.py

TECH-TESTER+usd@Tech-tester MINGW64 ~/Desktop/Python-Essentials/PythonIntro
$ python python_intro.py
bash: python: command not found

TECH-TESTER+usd@Tech-tester MINGW64 ~/Desktop/Python-Essentials/PythonIntro
$ PATH=$PATH:/c/Python27/

TECH-TESTER+usd@Tech-tester MINGW64 ~/Desktop/Python-Essentials/PythonIntro
$ python python_intro.py
bash: python: command not found

TECH-TESTER+usd@Tech-tester MINGW64 ~/Desktop/Python-Essentials/PythonIntro
$ export PATH="$PATH:/c/Python27"

TECH-TESTER+usd@Tech-tester MINGW64 ~/Desktop/Python-Essentials/PythonIntro
$ python python_intro.py
bash: python: command not found

TECH-TESTER+usd@Tech-tester MINGW64 ~/Desktop/Python-Essentials/PythonIntro
$ python
bash: python: command not found

抱歉,如果这是一个菜鸟问题,我在互联网上找到的所有内容似乎都超出了我的理解水平,而我处于这个非常基础的水平。

最佳答案

Meanwhile, I thought Anaconda came with the same py launcher as "official" Python, and offered the same option to install it to somewhere on your PATH.

首先尝试在常规 CMD 中检查。

where python

这将检查 python 是否在 PATH 中。
从那里,您可以开始在 CMD 或 git bash session 中使用 python。

关于Python 未在 GitBash 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51886936/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com