Python and Ubuntu versions

Cameron Simpson cs at cskk.id.au
Fri Jul 23 01:17:59 EDT 2021


On 23Jul2021 07:54, אורי <uri at speedy.net> wrote:
>I have a production server with Ubuntu 18.04 LTS (currently upgraded to
>Ubuntu 18.04.5 LTS) and I use Python in virtualenv - currently Python
>3.6.9. I'm using Django and I read that from Django 4.0, a minimal version
>of Python 3.8 will be required. I would like to know how I use the latest
>version of Python (3.10 or 3.9) with my production server - do I have to
>reinstall a new server with the latest Ubuntu LTS version? Or do I have to
>upgrade my current server's Ubuntu version by upgrading the same machine?
>Or should I keep the Ubuntu version and only upgrade Python? I'm also using
>other software such as PostgreSQL which is currently psql (PostgreSQL)
>10.17 (Ubuntu 10.17-0ubuntu0.18.04.1). Should I upgrade this too? And what
>is the risk that things will not work after I upgrade this?

I would install a totally separate Python from the vendor (ubunut) 
provided one. This prevents subtle changes to what the OS has been 
tested against.

You can built Python from source and install it, for example with a 
prefix like /usr/local/ptyhon-3.10. That gets you a different version; 
nothing in the OS stuff will try to use it, but you use it to invoke 
your Django app.

Both Python and PostgreSQL tend to be very forward compatible - your 
code should not need to change.

By making a separate install you're avoiding breaking OS stuff.

Do the build and install as yourself. I usually do the install step by 
making the install directory as root, then chowning it to me. Then you 
can do the install as you - this has the advantage the you're 
unprivileged and can't accidentally damage the OS install.

If you're just doing this for personal use then you can of course just 
install it in your own home directory, not root owned steps required at 
all.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list