Comments (14)
I had the same issue until I ran it using powershell as admin. worked first time.
from pip.
We did update our tar unpacking logic to rely more on the stdlib implementation to benefit from tarfile data filters (#12214). I don't have access to a development environment so I won't be able to debug this until later today, but for now, you can downgrade pip to 24.0.
from pip.
FYI I can reproduce with python -m pip install --dry-run py_find_1st
And the exception in question hasn't recently changed: https://github.com/python/cpython/blame/v3.12.4/Lib/tarfile.py#L2725
And Python can extract the tar file:
$ wget https://files.pythonhosted.org/packages/1d/24/4b4dc8fcf9ad5e6ac8ac6c6bd4be8100f07846c7a7ce6aa9c44ee1eaa429/py_find_1st-1.1.6.tar.gz
$ python -m tarfile -e py_find_1st-1.1.6.tar.gz
So it's probably related to the filtering feature.
from pip.
FWIW, python -m tarfile --filter data -e py_find_1st-1.1.6.tar.gz
seems fine too. Filtering added in #12214. Ahh, but it's wrapped with "pip specific" behavior. And I don't see a test to make sure good symlinks work, just tests for rejecting bad symlinks.
from pip.
I did a little investigation but didn't have time to post my results. The issue seems to be related to this tar file has a hard link that points from README.md to README.
I wasn't able to find another example of a real Python package that had the same problem.
It was very likely caused by #12214 if @encukou you want to take a look.
from pip.
getting the same on osx
from pip.
We use pandocfilters==1.4.1 and that exhibits the problem if you need a real world example of this breaking in the wild!
from pip.
The pandocfilters 1.4.1 sdist seems to be broken:
Note that the target of README.rst
is pandocfilters-1.4.1/README
, which does not exist as the error message says.
The same is true of py_find_1st
, which suggests that this might be a build backend bug creating an invalid sdist.
I don't think there's a pip issue here (even though things are reported as working in 24.0, I'd argue that's a bug in 24.0 rather than a regression).
Edit: Although on further reflection, this may depend on how a relative target for a hard link in a tar file is meant to be interpreted - as relative to the root of the tarfile, or as relative to the link. I don't know the answer to that, or even if there is a standard answer.
from pip.
Ah. @henryiii pointed out here that we have a filter with pip-specific behaviour. I suspect the issue is that our filter is checking for symlinks pointing out of the tarfile, but it's using the same logic for hard links, and not taking into account the fact that symlinks are relative to the link itself, whereas hardlinks are relative to the tarfile root (as I noted above).
That sounds like a bit of a mess to sort out. @encukou as the author of that change, can you take a look?
from pip.
I'll look into it.
from pip.
Seeing this on an older package qtfaststart
as well, though it seems to be impacted by the ---no-cache-dir parameter though this previously worked fine on 24.0
mdhiggins/sma-mod#17
mdhiggins/sickbeard_mp4_automator#1716
from pip.
I have the same issue while installing Freqtrade on Linux Mint
Downloading py_find_1st-1.1.6.tar.gz (8.6 kB)
ERROR: Exception:
Traceback (most recent call last):
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 179, in exc_logging_wrapper
status = run_func(*args)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 377, in run
requirement_set = resolver.resolve(
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
return bool(self._sequence)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 174, in __bool__
return any(self)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 162, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 53, in _iter_built
candidate = func()
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 185, in _make_candidate_from_link
base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 231, in _make_base_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 303, in __init__
super().__init__(
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in __init__
self.dist = self._prepare()
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 235, in _prepare
dist = self._prepare_distribution()
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 314, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 527, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 598, in _prepare_linked_requirement
local_file = unpack_url(
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 180, in unpack_url
unpack_file(file.path, location, file.content_type)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/utils/unpacking.py", line 316, in unpack_file
untar_file(filename, location)
File "/home/mohammad/Downloads/freqtrade/.venv/lib/python3.10/site-packages/pip/_internal/utils/unpacking.py", line 235, in untar_file
tar.extractall(location, filter=pip_filter)
File "/usr/lib/python3.10/tarfile.py", line 2257, in extractall
self._extract_one(tarinfo, path, set_attrs=not tarinfo.isdir(),
File "/usr/lib/python3.10/tarfile.py", line 2320, in _extract_one
self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
File "/usr/lib/python3.10/tarfile.py", line 2411, in _extract_member
self.makelink(tarinfo, targetpath)
File "/usr/lib/python3.10/tarfile.py", line 2508, in makelink
self._extract_member(self._find_link_target(tarinfo),
File "/usr/lib/python3.10/tarfile.py", line 2712, in _find_link_target
raise KeyError("linkname %r not found" % linkname)
KeyError: "linkname 'py_find_1st-1.1.6/README' not found"
from pip.
I've also encountered the same issue when trying to install the py-find-1st package. The error message I receive is:
KeyError: "linkname 'py_find_1st-1.1.6/README' not found"
The temporary workaround by downgrading pip to version 24.0, also resolved the issue for me.
from pip.
This should be fixed by #12799.
from pip.
Related Issues (20)
- Add TMPDIR to help output text to promote the info HOT 5
- error and WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', FileNotFoundError(2, 'Aucun fichier ou dossier de ce type'))': /simple/pip/ WARNING: Retrying (Retry(total=3, connect=Non HOT 2
- Release 24.2 HOT 3
- pyserial issue HOT 2
- Pip is unable to exclude Python pre-release versions via `python-requires`
- Pip is not working at all with any Package. SSL Errors! HOT 2
- WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', PermissionError(1, 'Operation not permitted'))': /simple/imblearn/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', PermissionError(1, 'Operation not permitted'))': /simple/imblearn/ HOT 1
- "WARNING: Error parsing dependencies of console" on m1 mac after update to pip 24.1.1 HOT 4
- pip fails in GitHub action with Invalid version (image name!) HOT 16
- Pip endlessly downloads all previous versions of python packages HOT 5
- Bugfix release PRs do not trigger test suite on CI HOT 1
- Pip memory usage for large cached install dominated by list of candiate pages HOT 1
- Missing git tag for 24.1.2 HOT 3
- Incorrect number of `"` in documentation
- Sharing a troubleshooting tool I made, simple barebone certifi.core (Lifeboat). HOT 5
- `pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'` raised when started by a separate process HOT 3
- Add tests for require-virtualenv HOT 1
- Please keep "pip search" function. HOT 1
- abi3audit dependencies HOT 2
- [24.1] name== hack for listing package versions no longer works HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pip.