-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
ValueError, whl in cache does not exist when running poetry install again #4163
Comments
Same issue for me using Windows and Poetry 1.2.0a1 and trying to install pywin32. The file does exist in cache, but I noticed the file path written in the ValueError is "\C:\Users". Is that the issue? |
Same here, I as well noticed the |
I ran into this same issue today. Calling We can strip this character by passing the malformed
Note that In fact, [0] https://github.com/python/cpython/blob/3.9/Lib/urllib/request.py#L1675 |
I ran into this yesterday also... Is there a temporary fix (workaround) until this is fixed permanently? |
My workaround is a short batch script that deletes the poetry cache as part of my ci pipeline before poetry install is executed. |
This bug actually gets stranger. The error message is also incorrect. If you look here: We see that it tests I'm not sure why |
I found the culprit! poetry/poetry/installation/executor.py Lines 673 to 680 in e180aab
At this point, from .utils import path_to_url, url_to_path and @property
def path(self) -> str:
if self.url.startswith("file:"):
p = str(url_to_path(self.url))
else:
p = urlparse.unquote(urlparse.urlsplit(self.url)[2])
return p Unfortunately this impacts a number of places where improper path handling happens, mainly in the executor module. It's a rabbit hole for sure and I need to look at my local edits and compare with a fresh clone to get ALL of the spots I changed code. In hindsight, it may be better to leave Link.path alone and instead fix all of the misuses of it. |
Is it known in which version this was introduced? I am seeing something very similar in poetry 1.1.9. |
As a workaround you could add the dependencies to poetry lock --no-update
poetry poetry export -f requirements.txt > requirements.txt
pip install -r requirements.txt The downside is that this wont install the dev dependencies. |
using version 1.1.10 here, same issue |
Had this as well downgrading to 1.1.8 fixed for me on Windows 10 python get-poetry.py --version 1.1.8 |
I downgrade to 1.1.8 then encounter this issue: #4409 |
Also have this issue with 1.1.8 on Windows 10. e.g.
Go to Run
Hope it helps other people in the meantime! |
After patching Link.path to properly handle Windows file URIs, poetry still fails to install the cached package:
This is because Executor.pip_install is being called with a string
We can get around this by using the fixed Link.path to "sanitize" string inputs to Executor.pip_install, stripping away the URI prefix before passing it to the utility pip_install function.
With these two changes, I can successfully install from the cache. |
Can this be made into a PR or is there something else to consider? |
I made two PRs: #4651 and python-poetry/poetry-core#222 I made them with the suggestions from this issue. I can not repro @vsutardja's issue that required a fixed executor (when I applied the fixes to Link.path my repro went away). I don't know if the fixes @jgentil is mentioning in executor.py still need to be put into the PRs. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).Windows 10 1909
poetry version: 1.2.0a1
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/Transmitt0r/ed8414abd90efaef9d4453ec05c48e1c
Issue
Hey everyone, I'm having issues when trying to run poetry install via jenkins. poetry config virtualenvs.in-project is true.
The install fails on the second installation attempt (always). It seems that there is an issue with the way caching works. Here is the trace:
Thanks in advance!
The text was updated successfully, but these errors were encountered: