Installing packages fails when already cached on Windows (making 1.1.9+ unusable on Windows)
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).
- OS version and name: Windows 10
- Poetry version: 1.1.9-1.1.11
- Link of a Gist with the contents of your pyproject.toml file:
name = "poetry_test"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.6"
lxml = "^4.6.3"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Issue
Installing a package that is already in the local pypoetry cache on windows fails since poetry 1.1.9.
$ poetry install -vvv --no-root
Using virtualenv: D:\user\src\temp\poetry_test\poetry_env
Installing dependencies from lock file
Finding the necessary packages for the current system
Package operations: 1 install, 0 updates, 0 removals
• Installing lxml (4.6.3): Pending...
• Installing lxml (4.6.3): Failed
ValueError
File \C:\Users\user\AppData\Local\pypoetry\Cache\artifacts\f7\90\e7\2d9752b05431b2ba90b4626b90f1674c505301a7cdbab89fd620aee824\lxml-4.6.3-cp36-cp36m-win_amd64.whl does not exist
at D:\user\src\temp\poetry_test\poetry_env\lib\site-packages\poetry\core\packages\file_dependency.py:40 in __init__
36│ except FileNotFoundError:
37│ raise ValueError("Directory {} does not exist".format(self._path))
38│
39│ if not self._full_path.exists():
→ 40│ raise ValueError("File {} does not exist".format(self._path))
41│
42│ if self._full_path.is_dir():
43│ raise ValueError("{} is a directory, expected a file".format(self._path))
44│
The problem does not occur, if the package is not cached.
Python version used is 3.6.8
Workaround
As a workaround we downgraded to 1.1.8 and poetry-core 1.0.4.
IMHO
It seems like this issue comes from the commit https://github.com/python-poetry/poetry/commit/8238cab2e1690b4e1b7ea4a460c6295b1b2c6cb7
The call to “archive.path” in line 615 of ‘poetry/installation/executor.py’ seems to remove only two of the three slashes for Windows file URLs (file:///c:/…). This results in an invalid path with a leading slash (visible in the command output File \C:\Users\user\AppData
), which in the end leads to a missing file exception.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:14
- Comments:23 (4 by maintainers)
Top Results From Across the Web
Issue when pip installing packages - Stack Overflow
I can install the greenlet package successfully through: pip install greenlet --no-cache-dir. I am using python310, It looks like have some ...
Read more >Failed to cache the downloaded installer
I'm trying to install and I keep getting an error message that it Failed to cache the installer. Error: 0x800b0109.
Read more >Release Notes - Chocolatey Software Docs
Chocolatey is software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages.
Read more >Bug listing with status RESOLVED with resolution TEST ...
1.4.1) segmentation fault'ed while starting up" status:RESOLVED ... Bug:95680 - "mount /dev/hda1 /mnt/windows fails" status:RESOLVED resolution:TEST-REQUEST ...
Read more >pipenv Documentation - Read the Docs
Will create a virtual env and install dependencies (if it does not exist already) The dependencies will be installed inside. • install package==0.2...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
No results found
Top Related Hashnode Post
No results found
I’m surprised this is allowed to go on for over a month. This makes poetry 100% unusable on windows. In fact, even downgrading doesn’t help if you’re on the newest version of python because there’s a fix for that in poetry 1.1.10.
I have a similar problem when poetry tries to install colorama
Windows 10 19043.1237 Python 3.9.7 Poetry 1.1.10 Poetry-core 1.0.6