How to update python to the latest version on ArchLinux?
Question:
How to install the latest python version 3.11.0
on ArchLinux through pacman?
ArchLinux wiki says current version is 3.10
, although python 3.11 has been officially released.
When running sudo pacman -Syyu p
I’m welcomed with warning: python-3.10.8-3 is up to date
.
Am I doing something wrong?
Answers:
Use AUR like "yay" to get the new python3.11.
If you haven’t installed yay on your system, setup yay by following these instructions
Run this command after setting up yay in your system:
yay -S python311
You can update python to the latest version on ArchLinux using the following command:
pacman -Syu python
You can install multiple versions and implementations of Python independently of your distro’s package manager using pyenv.
- Install pyenv with
sudo pacman -S pyenv
.
- Set up your shell for usage with pyenv https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv
- Install the Python version of your choice (please note that CPython will be built from source).
pyenv install -l # This will list all available versions
pyenv install 3.11.1 # This will install CPython 3.11.1
- Select the Python version as the default.
pyenv shell 3.11.1 # Use this version only for this shell session
pyenv local 3.11.1 # Use this version only when you are in this directory
pyenv global 3.11.1 # Use this version as the default version
Note that this will not replace Python installed by the package manager located at /usr/bin/python
. Pyenv will only change the PATH to point python
to its Python binary.
How to install the latest python version 3.11.0
on ArchLinux through pacman?
ArchLinux wiki says current version is 3.10
, although python 3.11 has been officially released.
When running sudo pacman -Syyu p
I’m welcomed with warning: python-3.10.8-3 is up to date
.
Am I doing something wrong?
Use AUR like "yay" to get the new python3.11.
If you haven’t installed yay on your system, setup yay by following these instructions
Run this command after setting up yay in your system:
yay -S python311
You can update python to the latest version on ArchLinux using the following command:
pacman -Syu python
You can install multiple versions and implementations of Python independently of your distro’s package manager using pyenv.
- Install pyenv with
sudo pacman -S pyenv
. - Set up your shell for usage with pyenv https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv
- Install the Python version of your choice (please note that CPython will be built from source).
pyenv install -l # This will list all available versions
pyenv install 3.11.1 # This will install CPython 3.11.1
- Select the Python version as the default.
pyenv shell 3.11.1 # Use this version only for this shell session
pyenv local 3.11.1 # Use this version only when you are in this directory
pyenv global 3.11.1 # Use this version as the default version
Note that this will not replace Python installed by the package manager located at /usr/bin/python
. Pyenv will only change the PATH to point python
to its Python binary.