无法在Linux Mint 19上安装Python 3.9.5

无法在Linux Mint 19上安装Python 3.9.5,python,Python,希望有人能帮忙。我已经在网上查阅了很多说明,但都不起作用。我只想通过终端安装最新的Python版本3.9.5(我的发行版上有版本2.7)。谢谢这是我经常得到的输出: $sudo apt get install python3 Reading package lists... Done Building dependency tree Reading state information... Done python3 is already the newest version (3.

希望有人能帮忙。我已经在网上查阅了很多说明,但都不起作用。我只想通过终端安装最新的Python版本3.9.5(我的发行版上有版本2.7)。谢谢这是我经常得到的输出:

$sudo apt get install python3

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3 is already the newest version (3.6.7-1~18.04).
The following packages were automatically installed and are no longer required:
  libllvm9 libreoffice-style-galaxy linux-headers-5.3.0-45
  linux-headers-5.3.0-45-generic linux-image-5.3.0-45-generic
  linux-modules-5.3.0-45-generic linux-modules-extra-5.3.0-45-generic
  Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_GB",
LC_ALL = (unset),
LC_TIME = "it_IT.UTF-8",
LC_MONETARY = "it_IT.UTF-8",
LC_ADDRESS = "it_IT.UTF-8",
LC_TELEPHONE = "it_IT.UTF-8",
LC_NAME = "it_IT.UTF-8",
LC_MEASUREMENT = "it_IT.UTF-8",
LC_IDENTIFICATION = "it_IT.UTF-8",
LC_NUMERIC = "it_IT.UTF-8",
LC_PAPER = "it_IT.UTF-8",
LANG = "en_GB"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up ubuntu-advantage-tools (27.0.2~18.04.1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'uaclient'
   dpkg: error processing package ubuntu-advantage-tools (--configure):
 installed ubuntu-advantage-tools package post-installation script subprocess returned error        exit status 1
 dpkg: dependency problems prevent configuration of ubuntu-minimal:
  ubuntu-minimal depends on ubuntu-advantage-tools; however:
  Package ubuntu-advantage-tools is not configured yet.

dpkg: error processing package ubuntu-minimal (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 ubuntu-advantage-tools
 ubuntu-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

    
正在阅读软件包列表。。。多恩
构建依赖树
正在读取状态信息。。。多恩
python3已经是最新版本(3.6.7-1~18.04)。
以下软件包已自动安装,不再需要:
libllvm9 libreoffice风格的galaxy linux-headers-5.3.0-45
linux-headers-5.3.0-45-generic linux-image-5.3.0-45-generic
linux-modules-5.3.0-45-generic linux-modules-extra-5.3.0-45-generic
使用“sudo apt autoremove”删除它们。
0已升级,0已新安装,0已删除,0未升级。
2未完全安装或拆除。
执行此操作后,将使用0 B的额外磁盘空间。
你想继续吗?[Y/n]Y
perl:警告:设置区域设置失败。
perl:警告:请检查您的区域设置:
LANGUAGE=“en_GB”,
LC_全部=(未设置),
LC_TIME=“it_it.UTF-8”,
LC_MONETARY=“it_it.UTF-8”,
LC_ADDRESS=“it_it.UTF-8”,
LC_TELEPHONE=“it_it.UTF-8”,
LC_NAME=“it_it.UTF-8”,
LC_MEASUREMENT=“it_it.UTF-8”,
LC_IDENTIFICATION=“it_it.UTF-8”,
LC_NUMERIC=“it_it.UTF-8”,
LC_PAPER=“it_it.UTF-8”,
LANG=“en_GB”
您的系统支持并安装了。
perl:警告:返回到标准语言环境(“C”)。
语言环境:无法将LC_CTYPE设置为默认语言环境:没有这样的文件或目录
语言环境:无法将LC_消息设置为默认语言环境:没有此类文件或目录
语言环境:无法将LC\U ALL设置为默认语言环境:没有此类文件或目录
正在设置ubuntu advantage工具(27.0.2~18.04.1)。。。
语言环境:无法将LC_CTYPE设置为默认语言环境:没有这样的文件或目录
语言环境:无法将LC_消息设置为默认语言环境:没有此类文件或目录
语言环境:无法将LC\U ALL设置为默认语言环境:没有此类文件或目录
回溯(最近一次呼叫最后一次):
文件“”,第2行,在
ModuleNotFoundError:没有名为“uaclient”的模块
dpkg:错误处理包ubuntu advantage tools(--configure):
已安装的ubuntu advantage tools包安装后脚本子流程返回错误退出状态1
dpkg:依赖性问题阻止配置ubuntu minimal:
ubuntuminimal依赖于ubuntuadvantage工具;然而:
尚未配置包ubuntu advantage tools。
dpkg:处理包UbuntuMinimal时出错(--configure):
依赖关系问题-保持未配置状态
处理时遇到错误:
ubuntu优势工具
UbuntuMinimal
E:子流程/usr/bin/dpkg返回错误代码(1)

首先要用以下内容更新Python路径:

export PYTHONPATH=${PYTHONPATH}:${HOME}:/usr/bin/python:/usr/lib/python3/dist-packages
而且看起来您的包数据库已损坏。尝试运行以下命令:

sudo dpkg --configure -a
就python而言,系统上已经安装了python 3.6.7。 运行
python--version
将列出python2.7,它通常预装在大多数基于Debian/Ubuntu的发行版中。而是运行
python3--version
。这将为您提供python 3.6.7


如果您需要最新版本的Python,可以使用死蛇ppa。

您是否阅读过
python3已经是最新版本了
。Python 3.6.5是存储库中的最新版本。错误消息来自包
ubuntuminimal
而不是
python3