为什么当我在 cmd 中输入 python - -version 时,除了空行之外什么都没有出现?

问题描述 投票:0回答:2

我已经下载了python 3.9。但是,在通过命令行检查版本时,我确实得到一个空行而不是版本。

我在cmd上使用了以下命令:

python --version 
python
2个回答
0
投票

试试这个:

  • python3 --version
  • python -V
  • 只需输入
    python
    ,它就会为您提供版本和其他一些信息:
Python your version and some stuff
Type "help", "copyright", "credits" or "license" for more information.
>>>

输入

exit()
,你就会退出

顺便说一句,

python --version --version
为您提供更详细的输出

并看到这个:https://docs.python.org/3/using/cmdline.html#generic-options


0
投票

在你的cmd中输入:

where python

它将为您提供系统中的所有“python”变量。 您可能有不需要的额外“python”变量 就像在这个位置创建的一样:

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps

只需按照路径操作并从那里删除“python”文件

© www.soinside.com 2019 - 2024. All rights reserved.