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 conflict when pip install because web3 is using old version of websocket #2705

Closed
jimmyjimmy94 opened this issue Nov 2, 2022 · 2 comments

Comments

@jimmyjimmy94
Copy link

  • Version: 5.31.1
  • Python: 3.10.4
  • OS: osx
  • pip freeze output
nanoid==2.0.0
pika==1.3.1
PyJWT==2.6.0
pymongo==4.2.0
pytest==7.1.3
randominfo==2.0.2
requests==2.21.0
siwe==2.1.1
pusher==3.2.0
dnspython==2.2.1
sanic==22.6.2
sanic-jwt==1.8.0
sanic-routing==22.3.0
sanic-cors==2.1.0

What was wrong?

When running pip install -r requirement.txt, it will throw Cannot install -r requirements.txt (line 8) and siwe because these package versions have conflicting dependencies. error.

Error output:

#8 12.34 The conflict is caused by:
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.31.1 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.31.0 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.30.0 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.29.2 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.29.1 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.29.0 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.28.0 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.27.0 depends on websockets<10 and >=9.1
#8 12.34     sanic 22.6.2 depends on websockets>=10.0
#8 12.34     web3 5.26.0 depends on websockets<10 and >=9.1
#8 12.34 
#8 12.34 To fix this you could try to:
#8 12.34 1. loosen the range of package versions you've specified
#8 12.34 2. remove package versions to allow pip attempt to solve the dependency conflict
#8 12.34 

How can it be fixed?

This is simply fixed by lossening the range of package versions of the sanic library but that would lead to downgrading sanic to version 21 which isn't very ideal

web3.py version constraint on websockets is a bit outdated since websockets latest version is now 10. Hope someone can consider updating the websockets dependency constraint to include websockets v10 as well.

@pacrob
Copy link
Contributor

pacrob commented Nov 2, 2022

Historically we've kept upper pins on most things, but that's changing starting with v6 - see PR #2648.

This won't be applied to v5 though, so you'd need to use the v6 beta, currently 6.0.0b7. so you'd need need to install from master right now. Dropping upper pins will be available in the next beta release.

@kclowes
Copy link
Collaborator

kclowes commented Nov 2, 2022

We can't support websockets v10+ in web3.py v5.x so you'll need to upgrade to the v6 beta version of web3.py or downgrade sanic.

@kclowes kclowes closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants