在Ubuntu 20.04上安装Python 3.9时出错>;解决了的

在Ubuntu 20.04上安装Python 3.9时出错>;解决了的,python,ubuntu-20.04,Python,Ubuntu 20.04,我想在我的Ubuntu 20.04上安装Python 3.9 因此,我尝试了以下步骤: 但是,我有以下错误: jordiba90@lts:~/Descargas/Python-3.9.0$ ./configure ––enable–optimizations configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: ––enable–optimizati

我想在我的Ubuntu 20.04上安装Python 3.9

因此,我尝试了以下步骤:

但是,我有以下错误:

jordiba90@lts:~/Descargas/Python-3.9.0$ ./configure ––enable–optimizations
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: ––enable–optimizations
checking build system type... Invalid configuration `––enable–optimizations': machine
`––enable–optimizations' not recognized
configure: error: /bin/bash ./config.sub ––enable–optimizations failed
无论我尝试什么,我都有很多其他的错误。可能是我操作系统的配置问题

我希望这个问题不会打破堆栈规则,但我真的不知道如何处理这个问题

PS:Python 3.9上的文件如下:

  • aclocal.m4
  • config.sub
  • 文法
  • 许可证
  • 杂项
  • 分析器
  • pyconfig.h.in
  • 工具行为规范
  • 配置
  • 包括
  • m4
  • 模块
  • 个人电脑
  • 蟒蛇
  • config.guess
  • 配置.ac
  • 安装sh
  • 苹果
  • netlify.toml
  • 印刷电路板
  • README.rstconfig.log
  • 医生
  • 解放党
  • Makefile.pre.in
  • 物体
  • 节目
  • setup.py
PS_2:我有Python3.8,我想安装3.9,但我有很多错误。从源代码安装是我上次做的,很简单

我刚试过,但没用

PS_3:我尝试使用hhe软件包管理器进行安装,结果是一样的,请让我获得更多的声誉,但帮助新手了解我做错了什么

jordiba90@lts:~/Descargas/Python-3.9.0$ python3 --version
Python 3.8.5
jordiba90@lts:~/Descargas/Python-3.9.0$ sudo apt-get install software-properties-common
[sudo] contraseña para jordiba90: 
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
software-properties-common ya está en su versión más reciente (0.98.9.2).
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 0 no actualizados.
jordiba90@lts:~/Descargas/Python-3.9.0$ sudo add-apt-repository ppa:deadsnakes/ppa
 This PPA contains more recent Python versions packaged for Ubuntu.

Disclaimer: there's no guarantee of timely updates in case of security problems or other issues. If you want to use them in a security-or-otherwise-critical environment (say, on a production server), you do so at your own risk.

Update Note
===========
Please use this repository instead of ppa:fkrull/deadsnakes.

Reporting Issues
================

Issues can be reported in the master issue tracker at:
https://github.com/deadsnakes/issues/issues

Supported Ubuntu and Python Versions
====================================

- Ubuntu 16.04 (xenial) Python 2.3 - Python 2.6, Python 3.1 - Python3.4, Python 3.6 - Python3.9
- Ubuntu 18.04 (bionic) Python2.3 - Python 2.6, Python 3.1 - Python 3.5, Python3.7 - Python3.9
- Ubuntu 20.04 (focal) Python3.5 - Python3.7, Python3.9
- Note: Python2.7 (all), Python 3.5 (xenial), Python 3.6 (bionic), Python 3.8 (focal) are not provided by deadsnakes as upstream ubuntu provides those packages.
- Note: for focal, older python versions require libssl1.0.x so they are not currently built

The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported.

Packages
========

The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu.  As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`.  Here is a list of packages that may be useful along with the default install:

- `python#.#-dev`: includes development headers for building C extensions
- `python#.#-venv`: provides the standard library `venv` module
- `python#.#-distutils`: provides the standard library `distutils` module
- `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module
- `python#.#-gdbm`: provides the standard library `dbm.gnu` module
- `python#.#-tk`: provides the standard library `tkinter` module

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 Más información: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Pulse [ENTRAR] para continuar o Ctrl+C para cancelar la adición.

0% [Trabajando]
Obj:1 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu focal InRelease
Obj:2 http://es.archive.ubuntu.com/ubuntu focal InRelease
Obj:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease        
Des:4 http://es.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]  
Des:5 http://es.archive.ubuntu.com/ubuntu focal-backports InRelease [98,3 kB]
Des:6 http://es.archive.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Des:7 http://es.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [229 kB]
Des:8 http://es.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [205 kB]
Des:9 http://es.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2.468 B]
Des:10 http://es.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1.764 B]
Des:11 http://es.archive.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24,3 kB]
Des:12 http://es.archive.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [56,6 kB]
Descargados 835 kB en 2s (440 kB/s)                                    
Leyendo lista de paquetes... Hecho
jordiba90@lts:~/Descargas/Python-3.9.0$ 
jordiba90@lts:~/Descargas/Python-3.9.0$ sudo apt-get update
Obj:1 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu focal InRelease
Obj:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Obj:3 http://es.archive.ubuntu.com/ubuntu focal InRelease
Obj:4 http://es.archive.ubuntu.com/ubuntu focal-updates InRelease
Obj:5 http://es.archive.ubuntu.com/ubuntu focal-backports InRelease
Obj:6 http://es.archive.ubuntu.com/ubuntu focal-security InRelease
Leyendo lista de paquetes... Hecho
jordiba90@lts:~/Descargas/Python-3.9.0$ sudo apt-get install python3.9
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
python3.9 ya está en su versión más reciente (3.9.0-5~20.04).
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 0 no actualizados.
jordiba90@lts:~/Descargas/Python-3.9.0$ python3 --version
Python 3.8.5
jordiba90@lts:~/Descargas/Python-3.9.0$ 

您希望从源代码安装python有什么原因吗

否则,只需使用软件包管理器进行安装:

$sudo apt获取安装软件属性公用
$sudo添加apt存储库ppa:死蛇/ppa
$sudo apt获取更新
$sudo apt get安装python3.9

我无法用Ubuntu 18.04和Python 3.9.0复制。但是,与其在这个问题上花费太多时间,您可以运行
/configure
,而不使用
--enable optimizations
标志,或者按照dejdej的建议,通过数据包管理器简单地安装;请查看。您所遵循的指南不适用于3.9,但您尝试使用的
configure
命令显然也适用于3.9。错误消息看起来好像您只是使用了错误的
configure
脚本。你确定这是3.9 tarball中的一个吗?我真的很抱歉triplee,但我试图根据我所做的详细说明一个问题,我认为这并不含糊。作为一个新手,你看起来很全面,所以我相信我会有动力再次参与。。谢谢,真的。上一个命令起作用了,但它没有取代python3。如果您想使Python 3成为系统范围内的默认Python 3,可能尝试
python3.9--version
或者
updatealternations
。问题是
软件属性common
安装Python 3.8,然后系统中有两个版本