title: Error on installing Python 3.9 on Ubuntu 20.04 > SOLVED
body: <p>I would like to install Python 3.9 on my Ubuntu 20.04.</p>
  <p>So, I tried following this steps:
  <a href="https://phoenixnap.com/kb/how-to-install-python-3-ubuntu" rel="nofollow noreferrer">https://phoenixnap.com/kb/how-to-install-python-3-ubuntu</a></p>
  <p>But, I have the following error:</p>
  <pre><code>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
  </code></pre>
  <p>Whatever I try I have so many other errors. Maybe it's a problem about configuration on my OS.</p>
  <p>I expect not to break Stack rules with this question but I don't really know how to handle this.</p>
  <p>PS: Files on Python 3.9 are the following:</p>
  <ul>
  <li>aclocal.m4</li>
  <li>config.sub</li>
  <li>Grammar</li>
  <li>LICENSE</li>
  <li>Misc</li>
  <li>Parser</li>
  <li>pyconfig.h.in</li>
  <li>Tools CODE_OF_CONDUCT.md</li>
  <li>configure</li>
  <li>Include</li>
  <li>m4</li>
  <li>Modules</li>
  <li>PC</li>
  <li>Python</li>
  <li>config.guess</li>
  <li>configure.ac</li>
  <li>install-sh</li>
  <li>Mac</li>
  <li>netlify.toml</li>
  <li>PCbuild</li>
  <li>README.rstconfig.log</li>
  <li>Doc</li>
  <li>Lib</li>
  <li>Makefile.pre.in</li>
  <li>Objects</li>
  <li>Programs</li>
  <li>setup.py</li>
  </ul>
  <p>PS_2: I have Python 3.8 and I would like to install 3.9 but I got a lot of errors. Installing from source code is what I did last time and it was easy.</p>
  <p>I just tried that and it doesn't work.</p>
  <p>PS_3: I tried to install using hhe package manager and it's the same result, please just quit me more reputation but help a novice to get what I am doing wrong</p>
  <pre><code>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$ 
  </code></pre>