dvc[ssh] generate weird error with Poetry env manager.
See original GitHub issueBug Report
dvc[ssh] can't be added to a project using Poetry env manager.Description
When I create my package environnement using Poetry adding dvc with [ssh] extra create a weird unrelated error. (This issue is crossposted on Poetry git here https://github.com/python-poetry/poetry/issues/4683 ).
Reproduce
Minimal failing example:
- poetry init
- poetry add dvc[ssh]
- poetry install
Full reproductibilty: get the pyproject.toml at the bottom, get an python installation with poetry installed and simply run poetry install with the file in the working directory.
Expected
Package dvc[ssh] should install fine with no error message.
Environment information
Output of dvc doctor:
As it workd with dvc alone (without the [ssh] extra, here is
$ dvc doctor
DVC version: 2.8.2 (pip)
Platform: Python 3.9.5 on Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.31 Supports: webhdfs (fsspec = 2021.10.1), http (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.6), https (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.6) Cache types: hardlink, symlink Cache directory: ext4 on /dev/sdb Caches: local Remotes: ssh, local Workspace directory: ext4 on /dev/sdb Repo: dvc, git
Additional Information (if any): For full reproductibility here is my pyproject.toml https://pastebin.com/avWt6UNk Here is my full error log from poetry https://pastebin.com/MBveHXbW
I have the weird feeling that this issue is due to the fact that you need to first install dvc package and THEN dvc[ssh] (bcrypt looks missing). But that’s not possible with Poetry, I can’t have two line called “dvc” (one vanialla, one with the extra) and I can’t have a line starting with dvc[ssh]
By removing the dvc with extras line from .toml file and doing poetry add dvc it works, but I can’t use ssh plugin. Doing poetry add dvc[ssh] fails with the erros in the previous pastebin log.
KeyError
Package('bcrypt', '3.2.0')
at ~/miniconda3/lib/python3.9/site-packages/poetry/puzzle/solver.py:270 in _solve
while bcrypt is not in my .toml.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)

Top Related StackOverflow Question
I’ll see whether I can reproduce it / locate the cause.
Fixed by #7171