Site icon TechGit

Python 3.11 Released! How to Install in Ubuntu 22.04 | 20.04 | 22.10

The popular Python programming language released version 3.11 today. Here’s the new features and how to install guide for all current Ubuntu releases.

Python 3.11 claimed to be 10-60% faster than the previous 3.10, and features:

How to Install Python 3.11 in Ubuntu

For Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04, and their derivatives, such as Linux Mint, there’s a popular Deadsnakes PPA maintains the packages for Python 3.11 as well as other Python versions.

NOTE: The PPA does not support Ubuntu 22.10. You may follow the bottom link to build it from source tarball.

1. First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:deadsnakes/ppa

Type user password when it asks (no asterisk feedback) and hit Enter to continue

2. Then refresh package cache via command below, though it’s done automatically in Ubuntu 20.04+:

sudo apt update

3. Finally, install python 3.11 via command:

sudo apt install python3.11

Or replace python3.11 with python3.11-full for IDE, pip package manager, etc.

Verify:

To verify, run python3.11 --version, python3.11 -m pip --version in terminal.

Set Python 3.11 as default

NOTE: change default Python3 in Ubuntu may cause issues for some default apps, such as GNOME Terminal

You may set the new Python package as default by using update-alternatives command line tool.

1. First, run command to create symbolic links for system default python (change python3.10 depends your Ubuntu edition)

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 110

2. Then, add the new Python 3.11 via command:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100

3. After that, you may choose which Python as Python3 at any time by running command:

sudo update-alternatives --config python3

Compile and install Python 3.11 manually from source

User may also compile the programming language from source tarball manually.

First, download the source from Python web site, then you may follow this step by step guide that I’ve tested in my Ubuntu 22.10 machine.

Original Article

FacebookTwitterTumblrRedditLinkedInHacker NewsDiggBufferGoogle ClassroomThreadsXINGShare
Exit mobile version