Skip to content
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

SolverProblemError with papermill #2819

Closed
2 of 3 tasks
AssassinTee opened this issue Aug 17, 2020 · 7 comments · Fixed by #2821
Closed
2 of 3 tasks

SolverProblemError with papermill #2819

AssassinTee opened this issue Aug 17, 2020 · 7 comments · Fixed by #2821
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected

Comments

@AssassinTee
Copy link

AssassinTee commented Aug 17, 2020

Information

  • 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: Ubuntu 18 LTS

  • Poetry version: 1.0.10 (and 1.0.5, too)

  • Link of a Gist with the contents of your pyproject.toml file: Not required

Issue

When installing papermill with poetry i got the following error message:

[SolverProblemError]
Because no versions of papermill match >2.1.2,<3.0.0
 and papermill (2.1.2) depends on black (*), papermill (>=2.1.2,<3.0.0) requires black (*).
So, because no versions of black match *
 and **myframework** on papermill (^2.1.2), version solving failed.

It looks like it failed to find any version of black, which is weird.

workaround

I just installed black by hand and papermill after that with:

poetry add black
poetry add papermill

This resolved my issue but I leave it here for the poetry devs and other users running into this issue

@AssassinTee AssassinTee added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 17, 2020
@abn
Copy link
Member

abn commented Aug 17, 2020

@AssassinTee can you try the latest release (1.0.10) or pre-release (1.1.0b2) please? This seems to be resolved.

$ poetry --version
Poetry version 1.0.10
$ poetry add black
Using version ^19.10b0 for black

Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file


Package operations: 8 installs, 0 updates, 0 removals

  - Installing appdirs (1.4.4)
  - Installing attrs (19.3.0)
  - Installing click (7.1.2)
  - Installing pathspec (0.8.0)
  - Installing regex (2020.7.14)
  - Installing toml (0.10.1)
  - Installing typed-ast (1.4.1)
  - Installing black (19.10b0)
$ poetry add papermill
Using version ^2.1.2 for papermill

Updating dependencies
Resolving dependencies... (0.4s)

Writing lock file


Package operations: 27 installs, 0 updates, 0 removals

  - Installing decorator (4.4.2)
  - Installing ipython-genutils (0.2.0)
  - Installing six (1.15.0)
  - Installing pyrsistent (0.16.0)
  - Installing traitlets (4.3.3)
  - Installing jsonschema (3.2.0)
  - Installing jupyter-core (4.6.3)
  - Installing python-dateutil (2.8.1)
  - Installing pyzmq (19.0.2)
  - Installing tornado (6.0.4)
  - Installing async-generator (1.10)
  - Installing certifi (2020.6.20)
  - Installing chardet (3.0.4)
  - Installing idna (2.10)
  - Installing jupyter-client (6.1.6)
  - Installing nbformat (5.0.7)
  - Installing nest-asyncio (1.4.0)
  - Installing textwrap3 (0.9.2)
  - Installing urllib3 (1.25.10)
  - Installing ansiwrap (0.8.4)
  - Installing entrypoints (0.3)
  - Installing nbclient (0.4.1)
  - Installing pyyaml (5.3.1)
  - Installing requests (2.24.0)
  - Installing tenacity (6.2.0)
  - Installing tqdm (4.48.2)
  - Installing papermill (2.1.2)

@AssassinTee
Copy link
Author

AssassinTee commented Aug 17, 2020

I updated poetry with poetry update self to version 1.0.10 and opened a new clean conda environment, only installing papermill with poetry add papermill still leads to the error:

[SolverProblemError]
Because no versions of papermill match >2.1.2,<3.0.0
 and papermill (2.1.2) depends on black (*), papermill (>=2.1.2,<3.0.0) requires black (*).
So, because no versions of black match *
 and poetrydemo depends on papermill (^2.1.2), version solving failed.
(testenv) user@kraft-Precision-5530:~/workspace/testdir/poetrydemo$ poetry --version
Poetry version 1.0.10
(testenv) user@kraft-Precision-5530:~/workspace/testdir/poetrydemo$ poetry add papermill
Using version ^2.1.2 for papermill

Updating dependencies
Resolving dependencies... (0.0s)

[SolverProblemError]
Because no versions of papermill match >2.1.2,<3.0.0
 and papermill (2.1.2) depends on black (*), papermill (>=2.1.2,<3.0.0) requires black (*).
So, because no versions of black match *
 and poetrydemo depends on papermill (^2.1.2), version solving failed.
(testenv) user@kraft-Precision-5530:~/workspace/testdir/poetrydemo$ 

Same with the beta:

(testenv) user@kraft-Precision-5530:~/workspace/testdir/poetrydemo$ poetry self update --preview
Updating to 1.1.0b2
 - Downloading poetry-1.1.0b2-linux.tar.gz 100%

Poetry (1.1.0b2) is installed now. Great!
(testenv) user@kraft-Precision-5530:~/workspace/testdir/poetrydemo$ poetry --version
Poetry version 1.1.0b2
(testenv) user@kraft-Precision-5530:~/workspace/testdir/poetrydemo$ poetry add papermill
Using version ^2.1.2 for papermill

Updating dependencies
Resolving dependencies... (0.0s)

  SolverProblemError

  Because no versions of papermill match >2.1.2,<3.0.0
   and papermill (2.1.2) depends on black (*), papermill (>=2.1.2,<3.0.0) requires black (*).
  So, because no versions of black match *
   and poetrydemo depends on papermill (^2.1.2), version solving failed.

  at ~/.poetry/lib/poetry/puzzle/solver.py:222 in _solve
      218│             packages = result.packages
      219│         except OverrideNeeded as e:
      220│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      221│         except SolveFailure as e:
    → 222│             raise SolverProblemError(e)
      223│ 
      224│         graph = self._build_graph(self._package, packages)
      225│ 
      226│         depths = []

@abn
Copy link
Member

abn commented Aug 17, 2020

@AssassinTee whats the python dependency for your project? And what is your python runtime version?

@AssassinTee
Copy link
Author

AssassinTee commented Aug 17, 2020

I am currently using python 3.7.7 and was able to create the issue with a clean conda environment (without other dependencies). The poetry project itself uses python="^3.7"

pyproject.toml for completion:

[tool.poetry]
name = "poetrydemo"
version = "0.1.0"
description = ""
authors = ["yes"]

[tool.poetry.dependencies]
python = "^3.7"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

@abn
Copy link
Member

abn commented Aug 17, 2020

Thanks for that. I can reproduce the issue now using:

poetry add --dry-run papermill

I was installing black before papermill; missed the part you said about it being the workaround :)

@abn abn added area/solver Related to the dependency resolver and removed status/triage This issue needs to be triaged labels Aug 17, 2020
abn added a commit to abn/poetry that referenced this issue Aug 17, 2020
This change ensures that packages that only have a pre-release versions
are pragmatically discovered via `find_packages` when a constraint (*)
is specified.

Resolves: python-poetry#2819
@abn
Copy link
Member

abn commented Aug 17, 2020

The root cause here is that when provided black (*) as a dependency; since black only has pre-release versions, no version was detected when resolving for dependencies of paparmill. I have attempted to fix it by modifying currrent behaviour such that such packages fallback to returning pre-release versions if constraint is (*). Alternative fix might be in poetry-core where a dependency that uses an any constraint is enabled to allow pre-release. The latter might have undesired side-effects.

abn added a commit to abn/poetry that referenced this issue Aug 17, 2020
This change ensures that packages that only have a pre-release versions
are pragmatically discovered via `find_packages` when a constraint (*)
is specified.

Resolves: python-poetry#2819
@abn abn closed this as completed in #2821 Aug 27, 2020
abn added a commit that referenced this issue Aug 27, 2020
This change ensures that packages that only have a pre-release versions
are pragmatically discovered via `find_packages` when a constraint (*)
is specified.

Resolves: #2819
Copy link

github-actions bot commented Mar 3, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants