python - Cmd Windows "python"命令有效,但 "python3"无效,尽管我的 python 版本是 3.6

标签 python windows cmd windows-10 anaconda

所以我在这里关注了一些帖子,例如 this .

所以我已经用 Anaconda 安装了 python 3.6。然后我进入 PATH 并插入 Python 的路径。

所以现在当我输入 cmd“python”时,我得到了响应

Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

但是,如果我输入“python3”,我会遇到常见的问题

'python3' is not recognized as an internal or external command,
operable program or batch file.

这是为什么?

最佳答案

您的问题可能已经得到解答;见this answer to: Python 3 installation on windows running from command line .具体来说:

OSX and Linux have python executable installed by default as a rule and it refers to Python 2 version in most cases at the moment that is why you need a separate python3 name there.

There is no Python on Windows by default. And therefore any version that you've installed is just python (I guess). The recommended way to manage multiple python versions is to use the Python launcher.

TL;DR:python3 在 Windows 上不是有效命令,无论它附带的发行版是什么(在您的情况下是 Anaconda)。

关于python - Cmd Windows "python"命令有效,但 "python3"无效,尽管我的 python 版本是 3.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48355319/

相关文章:

python - 如何 checkout 多个提交并将代码版本复制到另一个目录?

batch-file - 如何调用一个又一个批处理文件

python - 登录类(class) - Python

python - 在 BeautifulSoap 输出中用空格替换 <br>

windows - 如何为 Git-Bash 设置 16 种终端颜色?

从 Linux 编译到 Windows

windows - 是否有适用于 Windows Vista/7/8 的新 Midi API?

powershell - 使用正确的退出代码报告从 PowerShell 调用批处理文件,同时避免插入符号加倍

python 模拟 : mock. patch.object 陷阱

python - 在 Python 中解析巨大的、编码错误的 XML 文件