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

Keval Mehta
  • 129
  • 1
  • 6
  • 1
    Does the eclipse related problem has been solved ? kindly edit your title to match with the content of question. – Liso May 01 '19 at 10:57
  • Yes Jim that issue is resolved and updated the question as well. – Keval Mehta May 01 '19 at 10:59
  • 3
    Possible duplicate of [How do I install a different Python version using apt-get?](https://askubuntu.com/questions/682869/how-do-i-install-a-different-python-version-using-apt-get) or [How do I install Python 3.6 using apt-get?](https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get) – Byte Commander May 01 '19 at 13:39

1 Answers1

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.

Liso
  • 15,217
  • 3
  • 50
  • 80
  • 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 01 '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 01 '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 05 '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? – Bear Bile Farming is Torture Jan 01 '20 at 20:49
  • I ran "make test" and there were tests that failed. What do I do now? – Bear Bile Farming is Torture Jan 01 '20 at 20:50
  • @unathletic_coder you have access to all installed versions using `pythonx.x` syntax. In your case, it would be `python3.6`. If you use `python3`, it will use the default python 3 version (if there are multiple). – Roman Luštrik Jan 02 '20 at 11:57