Python
Updated Python package to latest version
The python3
package is now updated to latest version 3.9 in Fedora 33. Previously, In Fedora 32 python3
package version 3.8 was supported which is now updated.
This latest update of Python 3.9 will provide many enhancements. Some of the major highlights are:
-
Added merge (
|
) and update (|=
) union operators todict
class. -
Type hinting generics in standard collections.
-
Supports more flexible function and variable annotations.
-
Provides relaxing grammar restrictions by allowing decorators to be any valid expression.
-
Support for the IANA time zone database in the
zoneinfo
module. -
removeprefix
andremovesuffix
string methods will remove prefixes and suffixes from a string. -
CPython now uses a new parser based on parsing expression grammar (PEG).
Notes sur la migration des paquets pip installés par l’utilisateur
When you upgrade Fedora from versions 32 to Fedora 33, the main Python interpreter version changes from 3.8 to 3.9. If you have any Python packages installed using pip
, you must complete the following procedure to migrate them to the new version:
-
Install previous version of
python3
package:sudo dnf install python3.8
-
Get
pip
for the previous Python version:python3.8 -m ensurepip --user
-
Observez les paquets installés :
python3.8 -m pip list
-
Enregistrez la liste contenant les versions spécifiques :
python3.8 -m pip freeze > installed.txt
-
Install the same packages for the now default version:
python3 -m pip install --user -r installed.txt
-
Uninstall user-installed packages for Python 3.8; this ensures proper removal of files in
~/.local/bin
:python3.8 -m pip uninstall $(python3.8 -m pip list --user | cut -d" " -f1)
-
(Facultatif) Nettoyez la structure de dossiers désormais vide :
rm -rf ~/.local/lib/python3.8/
-
(Facultatif) Supprimez la version de Python qui n’est plus nécessaire :
sudo dnf remove python3.8
Additionally, if you have any pip
packages installed using sudo
, run the following commands before running the final step above which removes `python3.8`, or install it again temporarily:
-
Get
pip
for the previous Python version forroot
user:sudo python3.8 -m ensurepip
-
Observez les paquets installés au niveau du système :
sudo python3.8 -m pip list
-
Uninstall installed packages for 3.8; this ensures proper removal of files in
/usr/local/bin
:sudo python3.8 -m pip uninstall $(python3.8 -m pip list | cut -d" " -f1)
-
(Facultatif) Nettoyez la structure de dossiers désormais vide :
sudo rm -rf /usr/local/lib*/python3.8/
If you followed the first procedure, the packages are already installed for your user account, which is the preferred option. Avoid using |
Retire Python 3.4 and Python 2.6
The python34
and python26
packages are retired without replacement from Fedora 33. The packages will no longer be available from the repositories, but it may remain on existing installations. Both packages have been kept in Fedora for legacy reasons, and their continued maintenance has been proving more and more difficult while providing a decreasing benefit to the distribution, which is why they are now gone.
Want to help? Learn how to contribute to Fedora Docs ›