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

Dependency resolution failure: pip works but poetry cannot install turicreate 6.4.1 #3011

Closed
3 tasks done
malcolmgreaves opened this issue Oct 1, 2020 · 12 comments
Closed
3 tasks done
Labels
area/docs/faq Frequently duplicated/potential addition to FAQ area/solver Related to the dependency resolver kind/question User questions (candidates for conversion to discussion)

Comments

@malcolmgreaves
Copy link

malcolmgreaves commented Oct 1, 2020

  • 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: <OS X as well as Ubuntu 18.04-->

  • Poetry version: 1.1.0b2 & 1.1.0rc1

  • Link of a Gist with the contents of your pyproject.toml file: gist contains pyproject toml + result of poetry add -vvv turicreate=6.4.1

Issue

poetry does not correctly resolve the dependencies for turicreate whereas pip does.

turicreate version 6.4.1 depends on coremltools version 4.0b3. This can be seen by downloading the 3.8 wheel and inspecting:

$ pkginfo -f requires_dist turicreate-6.4.1-cp38-cp38-manylinux1_x86_64.whl
requires_dist: ['decorator (>=4.0.9)', 'numpy', 'pandas (>=0.23.2)', 'pillow (>=5.2.0)', 'prettytable (==0.7.2)', 'resampy (==0.2.1)', 'requests (>=2.9.1)', 'scipy (>=1.1.0)', 'six (>=1.10.0)', 'coremltools (==4.0b3)', 'tensorflow (>=2.0.0)', 'numba (<0.51.0)']

poetry add coremltools=4.0b3 works as expected. However, the problem comes with poetry add turicreate=6.4.1:

Updating dependencies
Resolving dependencies... (0.1s)

  SolverProblemError

  Because turicreate (6.4.1) depends on coremltools (3.3)
   and  depends on coremltools (4.0b3), turicreate is forbidden.
  So, because  depends on turicreate (6.4.1), version solving failed.

  at ~/.poetry/lib/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

In contrast, pip install turicreate=6.4.1 works as expected.

$ pip install turicreate==6.4.1
Collecting turicreate==6.4.1
  Downloading turicreate-6.4.1-cp38-cp38-manylinux1_x86_64.whl (92.0 MB)
     |████████████████████████████████| 92.0 MB 29 kB/s
...
Collecting coremltools==4.0b3
  Downloading coremltools-4.0b3-py3-none-any.whl (4.6 MB)
     |████████████████████████████████| 4.6 MB 2.3 MB/s
...

Why does poetry not find the correct dependency when pip does 😭 ?

@malcolmgreaves malcolmgreaves added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 1, 2020
@malcolmgreaves malcolmgreaves changed the title Fails to Resolve turicreate 6.4.1 when pip does correctly Dependency resolution failure: pip works but poetry cannot install turicreate 6.4.1 Oct 1, 2020
@finswimmer
Copy link
Member

Hello @malcolmgreaves,

how does your pyproject.toml looks like. Especially the entry for python is interesting. It looks like, depending on the python version the requirements for coremltools is different.

fin swimmer

@finswimmer finswimmer added the area/solver Related to the dependency resolver label Oct 1, 2020
@malcolmgreaves
Copy link
Author

👋 @finswimmer -- the pyproject.toml is in the Gist link above (https://gist.github.com/malcolmgreaves/b7ab6812eedce1adb1a2d03737dace3b).

Originally, I thought this might be a py3.7/8 issue -- but there's the right pkginfo for the turicreate==6.4.1 package.

Does the non semantic versioning 2.0 format of coremltools matter?

@abn
Copy link
Member

abn commented Oct 2, 2020

@malcolmgreaves the issue is the metadata associated with the package:

$ curl -sL https://pypi.org/pypi/turicreate/json | jq '.info.requires_dist'
[
  "decorator (>=4.0.9)",
  "numpy",
  "pandas (>=0.23.2)",
  "pillow (>=5.2.0)",
  "prettytable (==0.7.2)",
  "resampy (==0.2.1)",
  "requests (>=2.9.1)",
  "scipy (>=1.1.0)",
  "six (>=1.10.0)",
  "llvmlite (==0.31.0)",
  "coremltools (==3.3)",
  "tensorflow (>=2.0.0)"
]

Note the requirement specified for coremltools.

Additionally, the second issue you face is a debug log bug. :(

@finswimmer
Copy link
Member

@abn yeah I saw this too. Where does pypi take this metadata from? (and go to bed man, it's late already! 😄 )

@abn
Copy link
Member

abn commented Oct 2, 2020

@finswimmer haha. Probably a smart plan.

As for the metadata, it is what is publish during dist upload by the publisher. Twine, poetry etc.

@malcolmgreaves
Copy link
Author

Wow! Thank you so much for debugging this @abn 🙏 Does this mean that it is turicreate packaging & publishing error? (If so, I can file an issue on their GH page.)

@abn
Copy link
Member

abn commented Oct 2, 2020

@malcolmgreaves i think filing an issue with the project is the right approach here. Tools like poetry rely on this metadata to work correctly.

@abn abn added kind/question User questions (candidates for conversion to discussion) area/docs/faq Frequently duplicated/potential addition to FAQ and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 2, 2020
@abn
Copy link
Member

abn commented Oct 2, 2020

We should at some point write an FAQ about how to debug these issues.

@malcolmgreaves
Copy link
Author

malcolmgreaves commented Oct 2, 2020

@abn I filed an issue apple/turicreate#3342 and a PR apple/turicreate#3343 to fix it on turicreate's end. One of the project members is engaging on that GH issue thread about doing python version requirements in the package's published information. I think I'm a little out of my element commenting about "The Right Way" (tm) to do it -- if you have some time, could you add your 2 cents there?

@abn
Copy link
Member

abn commented Oct 2, 2020

@malcolmgreaves done.

@malcolmgreaves
Copy link
Author

Thank you so much for your help! 🙏

Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs/faq Frequently duplicated/potential addition to FAQ area/solver Related to the dependency resolver kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests

3 participants