Description
- OS version and name: Windows 10 21H1 with WSL2 (Ubuntu 20.04)
- Poetry version: 1.1.11
- Link of a Gist with the contents of your pyproject.toml file: https://pastebin.com/avWt6UNk
Issue
This issue has been cross-posted in the dvc git repo. Here: iterative/dvc#6886
dvc[ssh] can't be added to a project using Poetry env manager.
When I create my package environnement using Poetry adding dvc with [ssh] extra create a weird unrelated error.
Here is my full error log from poetry https://pastebin.com/MBveHXbW
Reproductibility
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.
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) as described here: https://dvc.org/doc/install/linux#install-with-pip
But that's not possible with Poetry, I can't have two line called "dvc" (one vanilla, one with the extra) and I can't have a line starting with dvc[ssh]
KeyError
Package('bcrypt', '3.2.0')
at ~/miniconda3/lib/python3.9/site-packages/poetry/puzzle/solver.py:270 in _solve
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.
EDIT: By using a fresh .toml file from poetry with only dvc[ssh] added, the same error arise.
Activity
sjawhar commentedon Nov 6, 2021
To help in debugging this, the bcrypt package doesn't get visited in the DFS here:
poetry/poetry/puzzle/solver.py
Lines 206 to 213 in 1da3e72
In this case, bcrypt is a dependency as an extra of an extra of a dependency: iterative/dvc#6886 (comment)
austinbutler commentedon Dec 7, 2021
To add some more data here, same issue with
celery[sqs]
since Celery 5.2.Add the following to
pyproject.toml
:Run
poetry lock
:This is working fine with Celery 5.1.x. So comparing the changes relating to SQS extras, my guess is that not explicitly defining dependencies for the extra causes this.
Seems
pip-tools
also has problems installingcelery[sqs]
as of 5.2: celery/celery#7070.Explicitly adding the
kombu[sqs]
dependency topyproject.toml
works around this for me.lucidyan commentedon Dec 16, 2021
For those who wanted fast solution for adding
dvc[ssh]
withpoetry
:poetry add bcrypt 'dvc[ssh]'
Clarification: I suppose the square brackets should be inside the quotes in the shell. Also,
poetry
has some problems with thebcrypt
-dependency resolving as pointed above, so you must add it explicitly.skshetry commentedon Dec 20, 2021
We are also getting a similar issue with
dvc[hdfs]
. Resolving numpy versions is slow too.Full log and stack trace
poetry add dvc[s3]
does not installboto3
iterative/dvc#72573 remaining items