3 ms·
It's hard if you're trying to update the system Python and need to upgrade every dependency for that but if you just want to have, say, “python3.7” in your path
by acdha 7y ago
It's hard if you're trying to update the system Python and need to upgrade every dependency for that but if you just want to have, say, “python3.7” in your path it's just a couple of commands:
https://docs.python-guide.org/starting/install3/linux/ https://docs.python-guide.org/starting/install3/linux/
~ $ docker run -it --rm ubuntu:xenial
root@b8cda311d766:/# apt-get update -qqy
root@b8cda311d766:/# apt-get install -qqy software-properties-common
…
root@b8cda311d766:/# add-apt-repository --yes ppa:deadsnakes/ppa
gpg: keyring `/tmp/tmpe354n0av/secring.gpg' created
gpg: keyring `/tmp/tmpe354n0av/pubring.gpg' created
gpg: requesting key 6A755776 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpe354n0av/trustdb.gpg: trustdb created
gpg: key 6A755776: public key "Launchpad PPA for deadsnakes" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
root@b8cda311d766:/# apt-get update -qqy
root@b8cda311d766:/# apt-get install -qqy python3.7
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpython3.7-minimal:amd64.
(Reading database ... 7603 files and directories currently installed.)
Preparing to unpack .../libpython3.7-minimal_3.7.3-1+xenial1_amd64.deb ...
Unpacking libpython3.7-minimal:amd64 (3.7.3-1+xenial1) ...
Selecting previously unselected package python3.7-minimal.
Preparing to unpack .../python3.7-minimal_3.7.3-1+xenial1_amd64.deb ...
Unpacking python3.7-minimal (3.7.3-1+xenial1) ...
Selecting previously unselected package libpython3.7-stdlib:amd64.
Preparing to unpack .../libpython3.7-stdlib_3.7.3-1+xenial1_amd64.deb ...
Unpacking libpython3.7-stdlib:amd64 (3.7.3-1+xenial1) ...
Selecting previously unselected package python3.7-lib2to3.
Preparing to unpack .../python3.7-lib2to3_3.7.3-1+xenial1_all.deb ...
Unpacking python3.7-lib2to3 (3.7.3-1+xenial1) ...
Selecting previously unselected package python3.7-distutils.
Preparing to unpack .../python3.7-distutils_3.7.3-1+xenial1_all.deb ...
Unpacking python3.7-distutils (3.7.3-1+xenial1) ...
Selecting previously unselected package python3.7.
Preparing to unpack .../python3.7_3.7.3-1+xenial1_amd64.deb ...
Unpacking python3.7 (3.7.3-1+xenial1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up libpython3.7-minimal:amd64 (3.7.3-1+xenial1) ...
Setting up python3.7-minimal (3.7.3-1+xenial1) ...
Setting up libpython3.7-stdlib:amd64 (3.7.3-1+xenial1) ...
Setting up python3.7-lib2to3 (3.7.3-1+xenial1) ...
Setting up python3.7-distutils (3.7.3-1+xenial1) ...
Setting up python3.7 (3.7.3-1+xenial1) ...
root@b8cda311d766:/# python3.7
Python 3.7.3 (default, Mar 26 2019, 01:59:45)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
root@b8cda311d766:/# exit
~ $