How to make Ubuntu 18.04 LTS use python 3.7 as default?

Ian Bruntlett ian.bruntlett at gmail.com
Thu Jul 30 11:21:38 UTC 2020


Hi Bo,

On Thu, 30 Jul 2020 at 07:17, Bo Berglund <bo.berglund at gmail.com> wrote:

> It has python 2.7 installed as its default python and now I am getting
> problems because apparently 2.7 is no longer the version used for some
> of my tools, which prints messages that all upgrades must use python 3
> (actually 3.5 or higher).
> I have managed to install 3.7 even though the ubuntu apt system only
> provides a much lower version.
> I did that using this instruction page:
> https://linuxize.com/post/how-to-install-python-3-7-on-ubuntu-18-04/
>

Are they *your* tools in that you wrote them?

If so, you could try this as the first line of your tools' source code:-
#!/usr/bin/env python3

Caution: I am not a Python expert but have dabbled with it.

If that does not help, ask a Python expert about using "Python Virtual
Environments".

I believe that the default Python is important to the proper functioning of
Ubuntu so I'd be really careful about changing things.

HTH,


Ian


-- 
-- ACCU - Professionalism in programming - http://www.accu.org
-- My writing - https://sites.google.com/site/ianbruntlett/
-- Free Software page -
https://sites.google.com/site/ianbruntlett/home/free-software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20200730/c90df5d4/attachment.html>


More information about the ubuntu-users mailing list