kevinheavey / anchorpy

The Python Anchor client.
https://kevinheavey.github.io/anchorpy/
MIT License
222 stars 59 forks source link

Pipenv dependency error #90

Closed aleixisp closed 2 years ago

aleixisp commented 2 years ago

When trying to install anchorpy using pipenv an error is raised.

✘ Locking Failed! 
[ResolutionFailure]:   File "/Users/aleixlopez/PyCharmProjects/olyn-api/lib/python3.9/site-packages/pipenv/resolver.py", line 741, in _main
[ResolutionFailure]:       resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]:   File "/Users/aleixlopez/PyCharmProjects/olyn-api/lib/python3.9/site-packages/pipenv/resolver.py", line 702, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:   File "/Users/aleixlopez/PyCharmProjects/olyn-api/lib/python3.9/site-packages/pipenv/resolver.py", line 684, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:   File "/Users/aleixlopez/PyCharmProjects/olyn-api/lib/python3.9/site-packages/pipenv/utils.py", line 1397, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:   File "/Users/aleixlopez/PyCharmProjects/olyn-api/lib/python3.9/site-packages/pipenv/utils.py", line 1110, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "/Users/aleixlopez/PyCharmProjects/olyn-api/lib/python3.9/site-packages/pipenv/utils.py", line 835, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Could not find a version that matches sumtypes<0.2,==0.1a6,>=0.1a6 (from -r /var/folders/46/y9z0rck93ns35hrd20x9q7tw0000gn/T/pipenv0fra6sqgrequirements/pipenv-7e6nvdvn-constraints.txt (line 23))
Skipped pre-versions: 0.1a1, 0.1a2, 0.1a2, 0.1a3, 0.1a3, 0.1a4, 0.1a4, 0.1a5, 0.1a5, 0.1a6, 0.1a6
There are incompatible versions in the resolved dependencies:
  sumtypes==0.1a6 (from -r /var/folders/46/y9z0rck93ns35hrd20x9q7tw0000gn/T/pipenv0fra6sqgrequirements/pipenv-7e6nvdvn-constraints.txt (line 23))

sumtypes dependency in anchorpy is causing this issue.

kevinheavey commented 2 years ago

What if you put this in your Pipfile:

allow_prereleases = true

Btw pipenv has a bad reputation and I don't recommend it

aleixisp commented 2 years ago

Thanks, will look into changing to poetry or PDM.