Bug 2014513 - Fedora 35: pip-upgraded pip installs packages to /usr/lib(64)/python3.10/site-packages/
Summary: Fedora 35: pip-upgraded pip installs packages to /usr/lib(64)/python3.10/site...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.10
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-15 12:56 UTC by Miro Hrončok
Modified: 2021-12-29 01:29 UTC (History)
8 users (show)

Fixed In Version: python3.10-3.10.1-2.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-29 01:29:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pypa pip issues 10647 0 None open Ability to force distutils as installation scheme backend even on Python 3.10 2021-11-09 15:18:41 UTC

Description Miro Hrončok 2021-10-15 12:56:48 UTC
Since pip 21.3, users who upgrade pip via pip will have a pip that installs packages to /usr/lib(64)/python3.10/site-packages/ instead of /usr/local/lib(64)/python3.10/site-packages/.

-----------------------------

Since Fedora 27, pip installs packages to /usr/local/lib(64)/python3.10/site-packages/ by default:

https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe

This also happens when users install/upgrade pip via pip, because our patch lives in the Python standard library and not pip.


However, pip 21.3+ uses sysconfig on Python 3.10+ instead of previously used distutils and hence users who upgrade pip to 21.3 or greater on Fedora 35 will have a pip that is no longer safe.


pip-installed pip 21.2.3:

[root@dde39f841e21 /]# pip install pello
Collecting pello
  Using cached Pello-1.0.2-py3-none-any.whl (6.0 kB)
Installing collected packages: pello
Successfully installed pello-1.0.2

[root@dde39f841e21 /]# pip uninstall pello
Found existing installation: Pello 1.0.2
Uninstalling Pello-1.0.2:
  Would remove:
    /usr/local/bin/pello_greeting
    /usr/local/lib/python3.10/site-packages/Pello-1.0.2.dist-info/*
    /usr/local/lib/python3.10/site-packages/pello/*
Proceed (Y/n)?


pip-installed pip 21.3:

[root@dde39f841e21 /]# pip install pello
Collecting pello
  Downloading Pello-1.0.2-py3-none-any.whl (6.0 kB)
Installing collected packages: pello
Successfully installed pello-1.0.2

[root@dde39f841e21 /]# pip uninstall pello
Found existing installation: Pello 1.0.2
Uninstalling Pello-1.0.2:
  Would remove:
    /usr/bin/pello_greeting
    /usr/lib/python3.10/site-packages/Pello-1.0.2.dist-info/*
    /usr/lib/python3.10/site-packages/pello/*
Proceed (Y/n)?



Note that especially users who pip-upgrade their pip are likely to brick their systems by running more sudo pip installs.




This is not a big problem on Fedora 33/34, because it only affects Python 3.10+ and system tools run on 3.9 there.

This is not an issue on Fedora 36 at all, because we have switched the patch to syscofnig: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/AAGUFQZ4RZDU7KUN4HA43KQJCMSFR3GW/


We could do that on Feodra 35 as well, but it is not very backward compatible, so we should figure out a better solution.

Comment 1 Miro Hrončok 2021-11-09 15:18:41 UTC
Cross-posting my attempt to allow us to tell pip to use distutils: https://github.com/pypa/pip/issues/10647

Comment 3 Miro Hrončok 2021-12-13 14:16:59 UTC
The https://src.fedoraproject.org/rpms/python3.10/pull-request/85 PR is no longer WIP.
The https://src.fedoraproject.org/rpms/python3.10/pull-request/83 PR was closed and is included in #85.

Comment 4 Fedora Update System 2021-12-20 21:52:33 UTC
FEDORA-2021-f9dded110a has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-f9dded110a

Comment 5 Fedora Update System 2021-12-21 01:18:55 UTC
FEDORA-2021-f9dded110a has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-f9dded110a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-f9dded110a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2021-12-29 01:29:08 UTC
FEDORA-2021-f9dded110a has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.