我刚进入一门介绍 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。
