openwallet-foundation / acapy

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
412 stars 512 forks source link

Installation error with pip #2035

Closed PatStLouis closed 1 year ago

PatStLouis commented 1 year ago

There is a circular incompatibility issue with the current pip candidate acapy 0.7.5.

When installing pydid 0.3.6 there is a constraint on typing-extensions<4.0.0,>=3.7.4, however, pydantic 1.10.2 requires typing-extensions>=4.1.0. This breaks the agent.

Manually updating typing-extensions with pip install typing-extensions==4.1.0 fixes this issue however creates an incompatibility with pydid 0.3.6.

@dbluhm would it be possible to change the typing-extensions requirements to >=4.1.0 in the pydid package?

PatStLouis commented 1 year ago

Issue is only appearing in one of my environments, under python 3.9.5. Works fine under python 3.9.2 in a different environment. I will keep investigating what is happening.

dbluhm commented 1 year ago

@PatStLouis there several dependency updates that need to take place in lockstep with a python update for ACA-Py. The current target version for ACA-Py is 3.6. Is 4.1.0 of typing-extensions still compatible with python 3.6?

TimoGlastra commented 1 year ago

Python 3.6 is released alsmost 6 years ago and reached end of life almost a year ago. Maybe the minimum python version for ACA-Py can be bumped?

https://endoflife.date/python

dbluhm commented 1 year ago

@TimoGlastra yes, this is in the works

PatStLouis commented 1 year ago

This is getting a bit messy but here are some of my findings.

My method of testing is building the following docker file with the --no-cache flag and interpreting the errors, playing with combinations of python, pip and typing-extensions versions.

FROM python:3.9-slim

RUN pip install --upgrade pip && \
    pip install aries-cloudagent && \
    pip install typing-extensions==3.7.4 && \
    aca-py --help

As far as I can tell, typing-extensions 4.1.0 is compatible with all python3.6 versions.

There are compatibility issues with python3.9 and typing-extensions 3.7.4, resulting in a bad pydid import:

  File "/usr/local/lib/python3.9/site-packages/pydid/resource.py", line 30, in <module>
    from typing_extensions import _Literal
    ImportError: cannot import name '_Literal' from 'typing_extensions'

Anything under python 3.6.9 causes some sort of issue depending on the pip version. ERROR: No matching distribution found for pydid~=0.3.3 (from aries-cloudagent)

pydid and pydantic are definitely fighting for typing-extensions versions and it would be good to realign this in future releases.

Definitely something to keep on the radar for the next aca-py release.

Regarding which python version to aim for for future release, given 3.6 is already end of life and 3.11 was just released, my uneducated guess would be to aim at 3.9. More experienced developers could have a better assessment. 3.9 is passed the bugfix phase so sounds pretty stable and will reach EoL in 2024.

dbluhm commented 1 year ago

I believe this is now resolved with ACA-Py moving to Python 3.9 and other dependency updates (both within ACA-Py and within PyDID).