DEV Community

Discussion on: How to Upgrade to Python 3.7 on Ubuntu 18.04/18.10

Collapse
 
chbrandt profile image
Carlos H Brandt

You forgot a second step -- maybe related to some crashes from some comments.
Notice that you have python*-config files in there too:

$ ls -lh /usr/bin/python*
lrwxrwxrwx 1 root root    9 Apr 16  2018 /usr/bin/python -> python2.7
lrwxrwxrwx 1 root root    9 Apr 16  2018 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3.5M Feb 27 16:10 /usr/bin/python2.7
lrwxrwxrwx 1 root root    9 May 28  2019 /usr/bin/python3 -> python3.6
-rwxr-xr-x 2 root root 4.4M Jan 26 16:33 /usr/bin/python3.6
lrwxrwxrwx 1 root root   33 Jan 26 16:33 /usr/bin/python3.6-config -> x86_64-linux-gnu-python3.6-config
-rwxr-xr-x 2 root root 4.4M Jan 26 16:33 /usr/bin/python3.6m
lrwxrwxrwx 1 root root   34 Jan 26 16:33 /usr/bin/python3.6m-config -> x86_64-linux-gnu-python3.6m-config
-rwxr-xr-x 1 root root 5.0M Feb 25 23:10 /usr/bin/python3.8
lrwxrwxrwx 1 root root   33 Feb 25 23:10 /usr/bin/python3.8-config -> x86_64-linux-gnu-python3.8-config
lrwxrwxrwx 1 root root   16 Oct 25  2018 /usr/bin/python3-config -> python3.6-config
Enter fullscreen mode Exit fullscreen mode

. AFAIU one should also apply a switch to python3-config.

In Step-2, I would recommend also doing:

$ sudo update-alternatives --install /usr/bin/python3-config python3-config /usr/bin/python3.6-config 1
$ sudo update-alternatives --install /usr/bin/python3-config python3-config /usr/bin/python3.8-config 2
Enter fullscreen mode Exit fullscreen mode

, and set accordingly (as explained in the article), but now for python3-config:

$ sudo update-alternatives --config python3-config
Enter fullscreen mode Exit fullscreen mode

Hope that is right and to complement the nice article.
/.\