我下载了 Python 3.9 但似乎什么都没发生

I downloaded Python 3.9 but nothing seems to have happened

好的,我正在尝试在我的计算机上安装 python 3.9。我对计算机的唯一了解是编程,我从 Python 开始。在那之前我真的不太了解任何地方,所以这就是为什么我无法在其他 Whosebug 问题等中得到我正在寻找的东西。我很难做到这一点。因此,我将准确描述我所做的事情:

我去了https://www.python.org/ and downloaded Python 3.9 (that button in the middle).

下载完成后,我打开它并进行了安装window。完成后,我去了我的终端(在我弄清楚它是什么之后)并输入 which python。这就是问题开始的地方;我得到了一个非常中性的 return(只是路径):

/usr/bin/python

之后,我做了python。然后出现了问题:

WARNING: Python 2.7 is not recommended. This version is included in macOS for compatibility with legacy software. Future versions of macOS will not include Python 2.7. Instead, it is recommended that you transition to using 'python3' from within Terminal.

Python 2.7.16 (default, Apr 17 2020, 18:29:03) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin Type "help", "copyright", "credits" or "license" for more information.

据我所知,计算机仍然安装了 Python 2.7.16(如果我理解正确,这是 Mac 的默认设置),而不是 3.9。在我观看的教程中,这并没有发生...我该怎么办?

编辑:顺便说一句,命令 python3.9python3.9.0 给出了相同的错误消息:

>>> python3.9
  File "<stdin>", line 1
    python3.9
            ^
SyntaxError: invalid syntax
>>> python3.9.0
  File "<stdin>", line 1
    python3.9.0
            ^
SyntaxError: invalid syntax

您的 python 似乎链接到 python2.7 而不是 python3。

只需在命令行中输入 python3,这应该可以解决您的问题。您可以通过在命令行输入 python3 --version 来检查版本。

同样适用于 pip3

最简单的方法是使用基于 anadonda 的 python 或基于 intel 的。 Anaconda based python for MacOS

这应该适合你。

错误和以 >>> 开头的行表明您仍在 Python2 解释器中。您需要在尝试 运行 Python3 之前退出它。您可以同时按下键盘上的 Ctrld 按钮,或者输入 exit().

退出后应该可以运行 python3.