Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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.
Description of problem:
Without python2, sealert cmds are not working.
# sealert --help
Traceback (most recent call last):
File "/usr/bin/sealert", line 56, in <module>
from setroubleshoot.util import get_identity, load_plugins, log_init, log_debug
File "/usr/lib/python3.6/site-packages/setroubleshoot/util.py", line 348, in <module>
from sepolicy import get_all_file_types
File "/usr/lib/python3.6/site-packages/sepolicy/__init__.py", line 9, in <module>
import setools
File "/usr/lib64/python3.6/site-packages/setools/__init__.py", line 24, in <module>
__version__ = pkg_resources.get_distribution("setools").version
AttributeError: module 'pkg_resources' has no attribute 'get_distribution'
Version-Release number of selected component (if applicable):
setroubleshoot-server-3.3.18-1.el8.x86_64
setroubleshoot-plugins-3.3.9-3.el8.noarch
python36-3.6-5.el8+1588+796e359f.x86_64
How reproducible:
100%
Steps to Reproduce:
1.nstall RHEL-8
2.try to run sealert cmd
Actual results:
AttributeError
Expected results:
no errors
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!
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.
Comment 6Petr Viktorin (pviktori)
2018-09-24 14:18:43 UTC
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'
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.
Comment 22RHEL Program Management
2019-06-14 01:53:01 UTC
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.
Description of problem: Without python2, sealert cmds are not working. # sealert --help Traceback (most recent call last): File "/usr/bin/sealert", line 56, in <module> from setroubleshoot.util import get_identity, load_plugins, log_init, log_debug File "/usr/lib/python3.6/site-packages/setroubleshoot/util.py", line 348, in <module> from sepolicy import get_all_file_types File "/usr/lib/python3.6/site-packages/sepolicy/__init__.py", line 9, in <module> import setools File "/usr/lib64/python3.6/site-packages/setools/__init__.py", line 24, in <module> __version__ = pkg_resources.get_distribution("setools").version AttributeError: module 'pkg_resources' has no attribute 'get_distribution' Version-Release number of selected component (if applicable): setroubleshoot-server-3.3.18-1.el8.x86_64 setroubleshoot-plugins-3.3.9-3.el8.noarch python36-3.6-5.el8+1588+796e359f.x86_64 How reproducible: 100% Steps to Reproduce: 1.nstall RHEL-8 2.try to run sealert cmd Actual results: AttributeError Expected results: no errors