【发布时间】:2022-07-05 23:35:42
【问题描述】:
我按照link 中的步骤安装了 python 3.9。
sudo apt updatesudo apt install python3.9python3.9sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.[old-version] 1sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2sudo update-alternatives --config python3
但是,它在第三点引发了python3.9 not found 的错误。另外,我注意到使用第二点安装的python3.9显示Note, selecting 'postgresql-plpython3-9.5' for regex 'python3.9'。
完整的消息是
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'postgresql-plpython3-9.5' for regex 'python3.9'
The following packages were automatically installed and are no longer required:
linux-aws-headers-4.4.0-1104 linux-aws-headers-4.4.0-1105 linux-aws-headers-4.4.0-1106 linux-aws-headers-4.4.0-1107 linux-aws-headers-4.4.0-1109 linux-aws-headers-4.4.0-1110 linux-aws-headers-4.4.0-1111
linux-aws-headers-4.4.0-1112 linux-aws-headers-4.4.0-1113 linux-aws-headers-4.4.0-1114
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
postgresql-plpython3-9.5
0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.
Need to get 0 B/40.6 kB of archives.
After this operation, 166 kB of additional disk space will be used.
Selecting previously unselected package postgresql-plpython3-9.5.
(Reading database ... 362651 files and directories currently installed.)
Preparing to unpack .../postgresql-plpython3-9.5_9.5.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking postgresql-plpython3-9.5 (9.5.25-0ubuntu0.16.04.1) ...
Processing triggers for postgresql-common (173ubuntu0.3) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Setting up postgresql-plpython3-9.5 (9.5.25-0ubuntu0.16.04.1) ...
为什么要设置 postgresql-plpython3-9.5,我该如何防止它这样做?
【问题讨论】:
-
它只选择了
postgresql-plpython3-9.5,因为您的源中没有python3.9包可用。 -
...现在,要开始尝试理解为什么会这样,我们需要阅读您的链接。请不要这样做——即使链接断开,问题也应该是独立的,足以回答问题。我们需要知道的一些事情才能回答这个问题:您正在运行哪个特定的发行版?您的
sources.list中有什么内容?上次您尝试从该sources.list文件中的所有位置检索包数据库时,apt-get update是否运行且没有错误?将所有这些的答案包含在问题本身中,而不是在链接后面。 -
@CharlesDuffy 我编辑了我的问题。
标签: python python-3.9