파이썬

파이썬 꾸러미를 최신 버전으로 최신화하였습니다

python3 꾸러미는 이제 페도라 33에서 최신버전 3.9로 최신화되었습니다. 앞서, 페도라 32에서 python3 꾸러미 버전 3.8이 지원되었으며 이는 현재 최신화 되었습니다.

파이썬 3.9의 최근 최신화는 많은 향상을 제공 할 것입니다. 몇몇 주요 핵심사항은 다음과 같습니다:

  • Added merge (|) and update (|=) union operators to dict 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 and removesuffix string methods will remove prefixes and suffixes from a string.

  • CPython now uses a new parser based on parsing expression grammar (PEG).

Notes on migrating user-installed pip packages

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:

  1. Install previous version of python3 package:

    sudo dnf install python3.8
  2. Get pip for the previous Python version:

    python3.8 -m ensurepip --user
  3. Observe the installed packages:

    python3.8 -m pip list
  4. Save the list with specific versions:

    python3.8 -m pip freeze > installed.txt
  5. Install the same packages for the now default version:

    python3 -m pip install --user -r installed.txt
  6. 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)
  7. Optionally, clean up the now empty directory structure:

    rm -rf ~/.local/lib/python3.8/
  8. Optionally, remove the unneeded Python version:

    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:

  1. Get pip for the previous Python version for root user:

    sudo python3.8 -m ensurepip
  2. Observe the system-installed packages:

    sudo python3.8 -m pip list
  3. 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)
  4. Optionally, clean up now empty directory structure:

    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 sudo pip in the future, these instructions are only intended to recover users who already used sudo pip in the past.

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.