2

After updating from version of Ubuntu 18.04 to 19.04, facing different issues as follows please give solution for given.

1) Python 3.6 is not working and default version is become python 3.7

This question is not to asking how to install py 3.6 after installing 3.7

3
4

You can download Python 3.6.7 source code from Python site, then compile it yourself.

wget -P ~/Downloads https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz
cd ~/Downloads
tar -xJf Python-3.6.7.tar.xz
cd Python-3.6.7

Proceed to installation.

./configure
make
make test
sudo make install

This will install Python as python3 executable, assuming that what you want.

6
  • You should mention that this can mess up the OS in some rare cases. Most python scripts will run fine on 3.6 instead of 3.7 as the changes are minimal, but there are rare cases when a script relies on the new additions to python 3.7 it might not work on 3.6. Not had in the short time to check all the scripts within my 19.04 installation thus this comment. – Videonauth May 1 '19 at 11:26
  • Also extension modules shipped with ubuntu 19.04 will be built against 3.7, not 3.6. Scripts relying on those extension modules will fail if run with your locally built 3.6. Fortunately most scripts ship in debian use the full path to the python interpreter, so if your locally built copy is installed in /usr/local the damage should be limited. – Peter Green May 1 '19 at 13:30
  • 3
    If you install sudo make altinstall (see README), it will not replace 3.7 as the default (this is documented in the README). – Roman Luštrik Jul 5 '19 at 12:07
  • @RomanLuštrik if it will not replace 3.7, then where will it be stored and what is the command to execute 3.6? – ganidat Jan 1 '20 at 20:49
  • I ran "make test" and there were tests that failed. What do I do now? – ganidat Jan 1 '20 at 20:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.