ValueError, whl in cache does not exist when running poetry install again
See original GitHub issue-
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!
de\user@PC C:\workspace>poetry install -vvv
Loading configuration file C:\Users\user\AppData\Roaming\pypoetry\config.toml
Adding repository private (https://artifactory-url.de)
Creating virtualenv envname in C:\workspace\.venv
Using virtualenv: C:\workspace\.venv
Installing dependencies from lock file
Finding the necessary packages for the current system
Package operations: 20 installs, 0 updates, 0 removals, 3 skipped
• Removing importlib-metadata (4.5.0): Skipped for the following reason: Not currently installed
• Removing typing-extensions (3.10.0.0): Skipped for the following reason: Not currently installed
• Removing zipp (3.4.1): Skipped for the following reason: Not currently installed
• Installing pyparsing (2.4.7)
Stack trace:
6 c:\users\user\appdata\roaming\pypoetry\venv\lib\site-packages\poetry\installation\executor.py:244 in _execute_operation
242|
243| try:
> 244| result = self._do_execute_operation(operation)
245| except EnvCommandError as e:
246| if e.e.returncode == -2:
5 c:\users\user\appdata\roaming\pypoetry\venv\lib\site-packages\poetry\installation\executor.py:321 in _do_execute_operation
319| return 0
320|
> 321| result = getattr(self, f"_execute_{method}")(operation)
322|
323| if result != 0:
4 c:\users\user\appdata\roaming\pypoetry\venv\lib\site-packages\poetry\installation\executor.py:462 in _execute_install
460|
461| def _execute_install(self, operation: Union[Install, Update]) -> int:
> 462| status_code = self._install(operation)
463|
464| self._save_url_reference(operation)
3 c:\users\user\appdata\roaming\pypoetry\venv\lib\site-packages\poetry\installation\executor.py:498 in _install
496| archive = self._download_link(operation, Link(package.source_url))
497| else:
> 498| archive = self._download(operation)
499|
500| operation_message = self.get_operation_message(operation)
2 c:\users\user\appdata\roaming\pypoetry\venv\lib\site-packages\poetry\installation\executor.py:648 in _download
646| link = self._chooser.choose_for(operation.package)
647|
> 648| return self._download_link(operation, link)
649|
650| def _download_link(self, operation: Union[Install, Update], link: Link) -> Link:
1 c:\users\user\appdata\roaming\pypoetry\venv\lib\site-packages\poetry\installation\executor.py:676 in _download_link
674| archive_hash = (
675| "sha256:"
> 676| + FileDependency(
677| package.name,
678| Path(archive.path) if isinstance(archive, Link) else archive,
ValueError
File \C:\Users\user\AppData\Local\pypoetry\Cache\artifacts\92\0f\cf\effdcd5d76a6186df0969f85b3b030284ff8058936d5016540b5258ea3\pyparsing-2.4.7-py2.py3-none-any.whl does not exist
at c:\users\user\appdata\roaming\pypoetry\venv\lib\site-packages\poetry\core\packages\file_dependency.py:41 in __init__
37| except FileNotFoundError:
38| raise ValueError("Directory {} does not exist".format(self._path))
39|
40| if not self._full_path.exists():
> 41| raise ValueError("File {} does not exist".format(self._path))
42|
43| if self._full_path.is_dir():
44| raise ValueError("{} is a directory, expected a file".format(self._path))
45|
Issue Analytics
- State:
- Created 2 years ago
- Reactions:24
- Comments:17
Top Results From Across the Web
'poetry install' command fails; *.whl files are not found
Specifically I found that deleting the AppData\Local\pypoetry\Cache\artifacts folder (I'm on Windows 10) worked for me. virtualenvs for ...
Read more >Local clone + Poetry - hydrolib-core documentation
This may occur when a conda environment was activated. Delete the AppData\Local\pypoetry\Cache directory. Then run conda deactivate to return to the base ...
Read more >Configuration | Documentation | Poetry - Python dependency ...
Configuration Poetry can be configured via the config command (see more about its usage here) or directly in the config.toml file that will...
Read more >Dependency Management With Python Poetry
toml file, it's not installed yet. As long as there's no poetry.lock file present in your project, you can run poetry install after...
Read more >Python projects documentation | k8saas documentation
If the vscode container is not running, the existing whl package will be used without the possibility of re-building it because building the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Also have this issue with 1.1.8 on Windows 10. My workaround is to go to the path specified, delete the cache and run
poetry install
again.e.g.
Go to
C:\Users\julie\AppData\Local\pypoetry\Cache
, delete everything.Run
poetry install
again and:Hope it helps other people in the meantime!
I found some much better PRs that already had some eyes, not sure what the path to get the PRs merged is.
1.1: #4549 1.2+: #4531