baking-bad / pytezos

🐍 Python SDK for Tezos | Michelson VM in Python
https://pytezos.org
MIT License
111 stars 36 forks source link

ResolutionImpossible error when installing pytezos with pip #350

Closed igorkh-fb closed 9 months ago

igorkh-fb commented 9 months ago

Python version: 3.10.13 Pip version: 23.3.1 OS: Ubuntu Linux 20.04

When trying to install the latest version of pytezos (and also some earlier versions) into a fresh virtual environment via pip, the installation fails with a ResolutionImpossible error.

Steps to reproduce:

$ python3.10 -m venv venv
$ source venv/bin/activate
$ pip install --upgrade pip
$ pip install pytezos==3.10.2

After about 15-20 minutes this results in the output:


ERROR: Cannot install pytezos and pytezos==3.10.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.20.0 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.19.2 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.19.1 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.19.0 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.18.6 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.18.5 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.18.4 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.18.3 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.18.2 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.18.1 depends on attrs>=22.2.0
    pytezos 3.10.2 depends on attrs<22.0.0 and >=21.4.0
    cattrs 22.1.0 depends on attrs>=20
    jsonschema 4.18.0 depends on attrs>=22.2.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

This started happening recently (didn't happen in August for sure). Perhaps jsonschema have released enough new versions for it to go beyond how much pip's backtracking resolver is willing to go.

It is possible to achieve successful dependency resolution by providing a constraint on jsonschema to use its' last version which does not require attrs>=22.2.0:

pip install pytezos==3.10.2 jsonschema==4.17.3

Currently pytezos' dependency on attrs is "^21.4.0". Would it be to relax it to accept version 22.2?

lukeisontheroad commented 9 months ago

I can confirm, I run into the same issue, fixing the jsonschema dependency resolved my problem.