Bug 1626408
Summary: | sealert: AttributeError: module 'pkg_resources' has no attribute 'get_distribution' | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Martin Hoyer <mhoyer> |
Component: | python-pip | Assignee: | Victor Stinner <vstinner> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Maryna Nalbandian <mnalband> |
Severity: | unspecified | Docs Contact: | Lenka Špačková <lkuprova> |
Priority: | unspecified | ||
Version: | 8.0 | CC: | cstratak, igkioka, jkejda, jwboyer, lvrabec, mhroncok, mmalik, plautrba, pviktori, torsava, vmojzis, vstinner |
Target Milestone: | rc | ||
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-pip-9.0.3-11.el8 | Doc Type: | Bug Fix |
Doc Text: |
When updating a Python package, pip conflicts with dnf: it removes files installed by dnf in /usr. It causes applications run by "python3 -I" to fail to import the module installed by dnf.
pip has been fixed to only install new files in /usr/local, but leave files installed by rpm in /usr/local unchanged.
For example, it is now possible to have and old version of setuptools installed by dnf in /usr, and a newer version installed by pip in /usr/local.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2019-06-14 01:53:01 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1550368 | ||
Bug Blocks: | 1623566, 1650327 |
Description
Martin Hoyer
2018-09-07 09:02:17 UTC
I tried to add / remove various SELinux related packages on my RHEL-8.0 VM, but sealert --help still works. Could you provide NVRs of SELinux related packages? # rpm -qa libsepol\* libsemanage\* libselinux\* setroubleshoot\* policycoreutils\* selinux-policy\* setools\* Hopefully, the NVRs help us to find the cause. Thanks! Do you use pip? Please see https://bugzilla.redhat.com/show_bug.cgi?id=1550368#c21 and later (In reply to Petr Lautrbach from comment #2) > Do you use pip? Please see > https://bugzilla.redhat.com/show_bug.cgi?id=1550368#c21 and later Yes, that's it. Fedora has a fix of the primary cause in https://src.fedoraproject.org/rpms/python-pip/pull-request/16 I leave it to the RHEL experts to decide if and how to fix this in RHEL. This misbehavior has a potential of destroying systems (rendering dnf/yum unusable), so I'd suggest to take it and fix this before RC. https://src.fedoraproject.org/rpms/python-pip/pull-request/10 has a previous (untested) version fo the patch applicable to pip 9. Problem summary: Upgrading a package to the latest *upstream* release using can remove the RPM-installed version, making it unusable with the rest of the system. It can be reproduced with: $ sudo python3 -m pip install --upgrade setuptools $ python3 -Es -c 'import pkg_resources; print(pkg_resources.get_distribution("setools").version)' Expected: a version number, e.g. 4.1.1 Actual result: Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: module 'pkg_resources' has no attribute 'get_distribution' I guess: s/using can/using sudo pip can/ Note: The fix doesn't prevent pip to remove files from /usr: # dnf install python3-pillow # ls /usr/lib64/python3.6/site-packages/PIL/version.py /usr/lib64/python3.6/site-packages/PIL/version.py # python3 -m pip uninstall Pillow Uninstalling Pillow-5.1.1: /usr/lib64/python3.6/site-packages/PIL /usr/lib64/python3.6/site-packages/Pillow-5.1.1-py3.6.egg-info Proceed (y/n)? y Successfully uninstalled Pillow-5.1.1 You are using pip version 9.0.3, however version 18.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. # ls /usr/lib64/python3.6/site-packages/PIL/version.py ls: cannot access '/usr/lib64/python3.6/site-packages/PIL/version.py': No such file or directory I've did some testing as well, didn't notice any problems. It works fine with venv as well. The uninstallation is a known issue, we could potentially add a warning for that in a later release. python-pip-9.0.3-11.el8 is now ready for testing. See my Comment 9 for possible manual validation of the fix. 800AutoClose The change described in this bug report should be resolved in the RHEL 8.0 release. It has been closed with a resolution of CURRENTRELEASE. If the solution does not work for you, open a new bug report. *** Bug 1650327 has been marked as a duplicate of this bug. *** |