无法找到并使用手动安装的Python

Naw*_*rma 5 ubuntu apt python3

我使用以下命令安装了最新的 Python 3.10:

sudo apt install python3.10
Run Code Online (Sandbox Code Playgroud)

但无法使用它。

当我运行相同的命令时,得到这个

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'postgresql-plpython3-10' for regex 'python3.10'
postgresql-plpython3-10 is already the newest version (10.19-0ubuntu0.18.04.1)
Run Code Online (Sandbox Code Playgroud)

请帮助我如何查找和使用已安装的 Python。

Voj*_*fny 9

您没有安装 Python 3.10,因为 Python 3.10 不适用于 Ubuntu 18.04(至少在官方 Ubuntu 存储库中,它仅适用于 21.04 及更高版本)。并且由于精确匹配不可用apt解释python3.10为正则表达式并决定安装匹配postgresql-plpython3-10包:

注意,为正则表达式“python3.10”选择“postgresql-plpython3-10”

如果你想在 18.04 上安装 Python 3.10,你可以使用deadsnakes PPA

sudo add-apt-repository ppa:deadsnakes/ppa
Run Code Online (Sandbox Code Playgroud)

然后安装python3.10