【发布时间】:2015-11-09 10:38:46
【问题描述】:
我有一个 python 脚本,我想在 MinGW bash 环境中运行(在 bash 脚本中)
我在 PATH 中安装了 python 3.5。
这基本上是当我尝试在 cmd 中启动 python,然后在 bash 中启动时发生的情况。
C:\Users\mkhoory-test>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
C:\Users\mkhoory-test>bash
bash-3.1$ python
- Cannot openbash-3.1$
我被难住了。这可能是什么原因?
【问题讨论】:
-
尝试设置'PATH'指向你安装的Python
-
首先,尝试使用 Python 可执行文件的绝对路径。如果它有效,那么您的
PATH变量有问题。 -
这很奇怪.. python 已经在路径中。但是,我似乎有 2 个位置用于 python .. 检查我在 Christian 的回答中的评论
标签: python windows bash cmd mingw