Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display path to corrupted files when pip fails to load wheel #13147

Open
1 task done
gaborbernat opened this issue Jan 8, 2025 · 1 comment
Open
1 task done

Display path to corrupted files when pip fails to load wheel #13147

gaborbernat opened this issue Jan 8, 2025 · 1 comment
Labels
C: error messages Improving error messages state: awaiting PR Feature discussed, PR is needed

Comments

@gaborbernat
Copy link

gaborbernat commented Jan 8, 2025

What's the problem this feature will solve?

This would help indentify the package that causes the problem.

Describe the solution you'd like

Currently when this happens one gets a stack trace of:

[2025-01-07T09:07:01.934Z] Successfully built pyspark

[2025-01-07T09:07:01.934Z] Installing collected packages: wcwidth, pytz, py4j, wrapt, urllib3, six, pyspark, propcache, prettytable, pluggy, packaging, numpy, multidict, jmespath, iniconfig, idna, fsspec, frozenlist, et-xmlfile, coverage, attrs, aioitertools, aiohappyeyeballs, yarl, python-dateutil, pytest, openpyxl, covdefaults, chispa,ai.remoteio, aiosignal, pytest-cov, pandas, botocore, aiohttp, aiobotocore, s3fs
[2025-01-07T09:07:01.934Z] test: exit 2 (32.29 seconds) /w> python -I -m pip install ai.remoteio chispa covdefaults numpy==1.26.4 openpyxl 'pandas<2' pyspark==3.5.0 pytest pytest-cov s3fs pid=108
[2025-01-07T09:07:01.934Z] ERROR: Exception:
[2025-01-07T09:07:01.934Z] Traceback (most recent call last):
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
[2025-01-07T09:07:01.934Z]     status = _inner_run()
[2025-01-07T09:07:01.934Z]              ^^^^^^^^^^^^
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
[2025-01-07T09:07:01.934Z]     return self.run(options, args)
[2025-01-07T09:07:01.934Z]            ^^^^^^^^^^^^^^^^^^^^^^^
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
[2025-01-07T09:07:01.934Z]     return func(self, options, args)
[2025-01-07T09:07:01.934Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 457, in run
[2025-01-07T09:07:01.934Z]     installed = install_given_reqs(
[2025-01-07T09:07:01.934Z]                 ^^^^^^^^^^^^^^^^^^^
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/req/__init__.py", line 70, in install_given_reqs
[2025-01-07T09:07:01.934Z]     requirement.install(
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/req/req_install.py", line 867, in install
[2025-01-07T09:07:01.934Z]     install_wheel(
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/operations/install/wheel.py", line 732, in install_wheel
[2025-01-07T09:07:01.934Z]     _install_wheel(
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/operations/install/wheel.py", line 590, in _install_wheel
[2025-01-07T09:07:01.934Z]     file.save()
[2025-01-07T09:07:01.934Z]   File "/w/.tox/test/lib/python3.11/site-packages/pip/_internal/operations/install/wheel.py", line 380, in save
[2025-01-07T09:07:01.934Z]     shutil.copyfileobj(f, dest, blocksize)
[2025-01-07T09:07:01.934Z]   File "/opt/bb/lib/python3.11/shutil.py", line 197, in copyfileobj
[2025-01-07T09:07:01.934Z]     buf = fsrc_read(length)
[2025-01-07T09:07:01.934Z]           ^^^^^^^^^^^^^^^^^
[2025-01-07T09:07:01.934Z]   File "/opt/bb/lib/python3.11/zipfile.py", line 966, in read
[2025-01-07T09:07:01.934Z]     data = self._read1(n)
[2025-01-07T09:07:01.934Z]            ^^^^^^^^^^^^^^
[2025-01-07T09:07:01.934Z]   File "/opt/bb/lib/python3.11/zipfile.py", line 1034, in _read1
[2025-01-07T09:07:01.934Z]     data += self._read2(n - len(data))
[2025-01-07T09:07:01.934Z]             ^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-01-07T09:07:01.934Z]   File "/opt/bb/lib/python3.11/zipfile.py", line 1069, in _read2
[2025-01-07T09:07:01.934Z]     raise EOFError
[2025-01-07T09:07:01.934Z] EOFError

From this is not clear what package caused the issue.

Alternative Solutions

One can use PIP_DEBUG but that requires CI changes.

Additional context

Better error message.

Code of Conduct

@gaborbernat gaborbernat added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Jan 8, 2025
@pfmoore
Copy link
Member

pfmoore commented Jan 8, 2025

This seems like a reasonable quality of life improvement - a PR fixing this would be appreciated.

@notatallshaw notatallshaw added state: awaiting PR Feature discussed, PR is needed C: error messages Improving error messages and removed type: feature request Request for a new feature S: needs triage Issues/PRs that need to be triaged labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: error messages Improving error messages state: awaiting PR Feature discussed, PR is needed
Projects
None yet
Development

No branches or pull requests

3 participants