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.
Bug 1932713 - python-pip: Improve error message when pip uninstalling RPM-installed package
Summary: python-pip: Improve error message when pip uninstalling RPM-installed package
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: python-pip
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: pre-dev-freeze
: ---
Assignee: Charalampos Stratakis
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-25 01:31 UTC by Meina Li
Modified: 2022-05-17 15:40 UTC (History)
5 users (show)

Fixed In Version: python-pip-21.2.3-2.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 15:37:35 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pypa pip issues 8954 0 None open Better error message for missing RECORD file 2021-03-10 14:21:12 UTC
Github pypa pip pull 9949 0 None open Provide a better error message when uninstalling packages without dist-info/RECORD 2021-05-05 14:44:15 UTC
Red Hat Product Errata RHBA-2022:3908 0 None None None 2022-05-17 15:37:37 UTC

Description Meina Li 2021-02-25 01:31:07 UTC
Description of problem:
Uninstall chardet failed

Version-Release number of selected component (if applicable):
kernel-5.11.0-1.el9.x86_64
python3-chardet-4.0.0-1.el9.noarch

How reproducible:
100%

Steps to Reproduce:
# pip list | grep chardet
chardet          4.0.0
# pip uninstall chardet
Found existing installation: chardet 4.0.0
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
    status = self.run(options, args)
  File "/usr/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py", line 87, in run
    uninstall_pathset = req.uninstall(
  File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 658, in uninstall
    uninstalled_pathset = UninstallPathSet.from_dist(dist)
  File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 541, in from_dist
    for path in uninstallation_paths(dist):
  File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 74, in unique
    for item in fn(*args, **kw):
  File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 92, in uninstallation_paths
    r = csv.reader(dist.get_metadata_lines('RECORD'))
  File "/usr/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1432, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/usr/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "/usr/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1616, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.9/site-packages/chardet-4.0.0.dist-info/RECORD'

Actual results:
Uninstall chardet failed

Expected results:
Should uninstall chardet successfully.

Additional info:

Comment 1 Miro Hrončok 2021-02-25 10:21:27 UTC
pip-uninstalling rpm-installed packages should not work, that is expected.

The error message is cryptic, we have opened https://github.com/pypa/pip/issues/8954 already.

Comment 2 Li, Jin 2021-03-01 02:00:45 UTC
Hi Miro

In my opinion, the issue here is that if the custom migrate from RHEL8 to RHEL9, when the custom's environment need chardet < 4.0 (specified by requirement in python project), the installation will fail in RHEL9 while it works well on RHEL8. I do not think it is acceptable.

Comment 3 Miro Hrončok 2021-03-01 09:31:36 UTC
> I do not think it is acceptable.

I respectfully disagree. If this was not acceptable, we would not be bale to update any Python package ever and we would be stuck with the RHEL 8 versions for eternity.

If a customer specifies Python requirements in projects, such as "chardet < 4.0", they can use PyPI (or their internal package server) to fetch and install the packages into a virtual Python environment. RHEL offers only a very limited set of packages in a very limited set of versions (usually one version per package for a specific Python version).

Uninstalling system packages with pip and replacing them with custom versions isn't (and never was) a supported use case. In fact, users can brick their system when they do that.

Before we go any further: What **exactly** do you try to accomplish here? I don't think uninstalling chardet is the end goal here, is it?

Comment 4 Li, Jin 2021-03-05 07:55:06 UTC
Hi Miro,

Actually i can create a virtual env to install the pip package chardet, just a little curious about the system behavior change from RHEL8 to RHEL9. Feel free to close this bug since there's been a pip issue to track the log problem. Thanks for your explanation

Comment 5 Miro Hrončok 2021-05-05 14:44:15 UTC
Upstream PR: https://github.com/pypa/pip/pull/9949

Let's wait a bit for their feedback before we backport it.

Comment 6 Petr Viktorin (pviktori) 2021-06-16 12:28:36 UTC
It was merged upstream, so we can backport (or rebase after release)

Comment 7 Petr Viktorin (pviktori) 2021-06-16 12:30:54 UTC
It should first go in Fedora Rawhide and 34.

Comment 9 Charalampos Stratakis 2021-09-14 15:56:28 UTC
(In reply to Charalampos Stratakis from comment #8)
> PR: https://gitlab.com/redhat/centos-stream/rpms/python-pip/-/jobs/1589581440

Oos that was the CI link. Proper link: https://gitlab.com/redhat/centos-stream/rpms/python-pip/-/merge_requests/4

Comment 15 errata-xmlrpc 2022-05-17 15:37:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: python-pip), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:3908


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