crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

Dependency Errors When Installing Crossbar With Pip #2069

Open Skully17 opened 1 year ago

Skully17 commented 1 year ago

Hello,

I can not currently install Crossbar with pip because of dependency errors. Originally I tried to install v23.1.2 from GitHub and it gave me this error:

ERROR: Cannot install autobahn[compress,encryption,scram,serialization,twisted,xbr]==23.1.2, crossbar, crossbar==23.1.2 and web3[ipfs]==6.0.0 because these package versions have conflicting
dependencies.                                                                                                                                                                                

The conflict is caused by:
   crossbar 23.1.2 depends on eth-abi 4.0.0b2 (from git+https://github.com/ethereum/eth-abi.git@v4.0.0-beta.2#egg=eth-abi)
   py-eth-sig-utils 0.4.0 depends on eth-abi>=1.1.1
   autobahn[compress,encryption,scram,serialization,twisted,xbr] 23.1.2 depends on eth-abi 4.0.0b2 (from git+https://github.com/ethereum/eth-abi.git@v4.0.0-beta.2#egg=eth-abi)
   web3[ipfs] 6.0.0 depends on eth-abi>=4.0.0

I have also tried v23.1.1 from GitHub:

ERROR: Cannot install autobahn[compress,encryption,scram,serialization,twisted,xbr]==23.1.2 and crossbar==23.1.1 because these package versions have conflicting dependencies.

The conflict is caused by:
   crossbar 23.1.1 depends on web3 6.0.0b9 (from git+https://github.com/ethereum/web3.py.git@v6.0.0-beta.9#egg=web3) [ipfs]
   autobahn[compress,encryption,scram,serialization,twisted,xbr] 23.1.2 depends on web3 6.0.0 (from git+https://github.com/ethereum/web3.py.git#v6.0.0-beta.9#egg=web3) [ipfs]

…And even v22.6.1 from the newest official PyPi package, which gives a slightly different error:

ERROR: Packages installed from PyPI cannot depend on packages which are not also hosted on PyPI.
autobahn depends on web3[ipfs]@ git+https://github.com/ethereum/web3.py.git#v6.0.0-beta.9#egg=web3

I believe that the problem originates from Autobahn because it instals web3 6.0.0 (which instals eth-abi 4.0.0) when it should be installing web3 6.0.0b2 (which instals the desired eth-abi 4.0.0b2. Could the requirements be pinned to specific versions?

If it helps, this problem is very recent. I installed Crossbar successfully on 22/3/23 and first noticed the error on 27/3/23.

DZabavchik commented 1 year ago

Confirmed. Having exact same issue.

Attempt to pre-install all deps with requirements-pinned.txt produces:

#9 109.2 ERROR: Packages installed from PyPI cannot depend on packages which are not also hosted on PyPI.
#9 109.2 autobahn depends on web3[ipfs]@ git+https://github.com/ethereum/web3.py.git#v6.0.0-beta.9#egg=web3
michael-suissa commented 1 year ago

Apologies for adding a me-too but I am having the same issue with trying to install crossbar from master and for good measure, I tested it on python 3.9 and python 3.11. I see the the same eth-abi version error as in the first error listed in @Skully17 's post. It appears crossbar depends on eth-abi 4.0.0b2 and crossbar depends on autobahn depends on web3(master) depends on eth-abi 4.0.0

Skully17 commented 1 year ago

I have made some changes to the requirements in both Crossbar and Autobahn:

These changes allow me to install Crossbar and Autobahn using Pip. I have done some basic tests (Run a program that uses Crossbar and performed some WAMP actions) and it seems fine. Are there any specific tests I can run/do to ensure that these changes are suitable?

oberstet commented 1 year ago

@Skully17 awesome! using release versions will improve things hopefully.

sidenote: using those beta versions was required since unfortunately the python ethereum projects use fixed upper bounds on dependencies, and this often leads to conflict with app (like crossbar) depending on more than one direct dependency, which in turn depend on indirect dependencies with conflicting upper bounds. the ethereum python project is "discussing" the issue .. but I needed to make it work now. hence the beta stuff, and other hacks I can't recall now;) anyways, hopefully things will get better with ethereum python deps over time .. it's a major PITA

so I'd like to merge your changes moving to release deps!

Are there any specific tests I can run/do to

testing a full, clean, fresh install of crossbar in a new venv .. if that works, that's good for me! I would merge, then refreeze deps and bump crossbar version, publish on pypi ...

oberstet commented 1 year ago

just noting, there also is https://github.com/crossbario/crossbar/issues/2061 - not sure if there is still a problem, or what exactly would a solution look like. I kinda grew tired of python dependency issues for the time being;)

oberstet commented 1 year ago

one more note: this needs an update then as well https://github.com/crossbario/autobahn-python/blob/01165cf27ada0c246cc23a1e5aac07a6b6839bdc/setup.py#L117 - that should avoid/remove issues that would otherwise result (as crossbar will first install autobahn[xbr] normally, and the latter deps are now - once this update here lands - would be older ..)