Add python3.7 as alternate python along with default on Ubuntu

My default python is 2.7 and I want python 3.7 along with it:

  1. Go to opt directory $ cd /opt
  2. Create a directory $ mkdir python3
  3. Download Python 3.7 $ wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
  4. Extract the python 3.7 tar file $ tar xzf Python-3.7.4.tgz
  5. To compile the source go to $ cd Python-3.7.4
  6. To get release build with all stable optimizations active (PGO, etc), execute $ sudo ./configure --enable-optimizations Inside Python-3.7.4 directory
  7. To prevent replacing of default python binary file /usr/bin/python, use $ sudo make altinstall
  8. To confirm the installation use $ python3.7 –version and which python3.7

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>