Ubuntu 20はPython 3.8.10が標準でインストールされましたが、追加でpython 3.10もインストールしてみました。
How To Install Python 3.10 on Ubuntu 20.04|18.04
https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/
- software-properties-commonのインストール
- deadsnakes PPAを追加
- python3.10のインストール
すでにインストールされていました。このソフトはRepositoryの追加を簡単にするスクリプトのようです。
1 2 3 4 5 6 7 |
rootlinks@Ubuntu20:~$ sudo apt install software-properties-common Reading package lists... Done Building dependency tree Reading state information... Done software-properties-common is already the newest version (0.99.9.8). software-properties-common set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
下記のコマンドでdeadsnakes PPAをAPTパッケージマネージャソースに追加します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
rootlinks@Ubuntu20:~$ sudo add-apt-repository ppa:deadsnakes/ppa This PPA contains more recent Python versions packaged for Ubuntu. Disclaimer: there's no guarantee of timely updates in case of security problems or other issues. If you want to use them in a security-or-otherwise-critical environment (say, on a production server), you do so at your own risk. Update Note =========== Please use this repository instead of ppa:fkrull/deadsnakes. Reporting Issues ================ Issues can be reported in the master issue tracker at: https://github.com/deadsnakes/issues/issues Supported Ubuntu and Python Versions ==================================== - Ubuntu 18.04 (bionic) Python2.3 - Python 2.6, Python 3.1 - Python 3.5, Python3.7 - Python3.11 - Ubuntu 20.04 (focal) Python3.5 - Python3.7, Python3.9 - Python3.11 - Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal) are not provided by deadsnakes as upstream ubuntu provides those packages. - Note: for focal, older python versions require libssl1.0.x so they are not currently built The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported. Packages ======== The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu. As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`. Here is a list of packages that may be useful along with the default install: - `python#.#-dev`: includes development headers for building C extensions - `python#.#-venv`: provides the standard library `venv` module - `python#.#-distutils`: provides the standard library `distutils` module - `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module - `python#.#-gdbm`: provides the standard library `dbm.gnu` module - `python#.#-tk`: provides the standard library `tkinter` module Third-Party Python Modules ========================== Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't. To install 3rd-party Python modules, you should use the common Python packaging tools. For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide: https://packaging.python.org/installing/ Sources ======= The package sources are available at: https://github.com/deadsnakes/ Nightly Builds ============== For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa Press [ENTER] to continue or Ctrl-c to cancel adding it. Hit:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease Hit:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease Hit:4 http://archive.ubuntulinux.jp/ubuntu focal InRelease Hit:5 http://archive.ubuntulinux.jp/ubuntu-ja-non-free focal InRelease Hit:6 https://dl.google.com/linux/chrome/deb stable InRelease Hit:7 http://security.ubuntu.com/ubuntu focal-security InRelease Get:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease [18.1 kB] Get:9 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main i386 Packages [11.6 kB] Get:10 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages [22.5 kB] Get:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main Translation-en [5168 B] Fetched 57.3 kB in 3s (17.5 kB/s) Reading package lists... Done |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
rootlinks@Ubuntu20:~$ sudo apt install python3.10 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libpython3.10-minimal libpython3.10-stdlib python3.10-minimal Suggested packages: python3.10-venv binfmt-support The following NEW packages will be installed: libpython3.10-minimal libpython3.10-stdlib python3.10 python3.10-minimal 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 5036 kB of archives. After this operation, 19.8 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 libpython3.10-minimal amd64 3.10.1-1+focal3 [802 kB] Get:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 python3.10-minimal amd64 3.10.1-1+focal3 [1917 kB] Get:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 libpython3.10-stdlib amd64 3.10.1-1+focal3 [1792 kB] Get:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 python3.10 amd64 3.10.1-1+focal3 [524 kB] Fetched 5036 kB in 9s (582 kB/s) Selecting previously unselected package libpython3.10-minimal:amd64. (Reading database ... 183141 files and directories currently installed.) Preparing to unpack .../libpython3.10-minimal_3.10.1-1+focal3_amd64.deb ... Unpacking libpython3.10-minimal:amd64 (3.10.1-1+focal3) ... Selecting previously unselected package python3.10-minimal. Preparing to unpack .../python3.10-minimal_3.10.1-1+focal3_amd64.deb ... Unpacking python3.10-minimal (3.10.1-1+focal3) ... Selecting previously unselected package libpython3.10-stdlib:amd64. Preparing to unpack .../libpython3.10-stdlib_3.10.1-1+focal3_amd64.deb ... Unpacking libpython3.10-stdlib:amd64 (3.10.1-1+focal3) ... Selecting previously unselected package python3.10. Preparing to unpack .../python3.10_3.10.1-1+focal3_amd64.deb ... Unpacking python3.10 (3.10.1-1+focal3) ... Setting up libpython3.10-minimal:amd64 (3.10.1-1+focal3) ... Setting up python3.10-minimal (3.10.1-1+focal3) ... Setting up libpython3.10-stdlib:amd64 (3.10.1-1+focal3) ... Setting up python3.10 (3.10.1-1+focal3) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... |
Python 3.10.1がインストールできました。
1 2 3 4 5 6 |
rootlinks@Ubuntu20:~$ python3.10 --version Python 3.10.1 rootlinks@Ubuntu20:~$ python3.8 --version Python 3.8.10 rootlinks@Ubuntu20:~$ python --version Python 3.8.10 |