0

My python script is using atproto and simpleobsws but they are both asking for incompatible versions of websockets..

simpleobsws 1.4.3 requires websockets>=14.0

atproto 0.0.62 requires websockets<14,>=12

I currently have websockets==14.0 installed.

How can I install and use websockets==13.1 for atproto while using the other version for simpleobsws?

All these packages will be installed in my virtual environment .venv.

4
  • 2
    You can't, python dependencies are uniquely identified by name, and this causes some problems sometimes. You just discovered a so-called "dependency hell". There can be only one version of every package (unless it got its import path changed mid-way, but websockets did not). That actually makes sense: what if one of those packages modifies websockets? What if your dependency actually needs a true singleton somewhere and will break if there are two instances of it fighting for some physical resources? Commented Oct 10 at 1:26
  • I suppose I'll have to separate the two scripts into separate virtual environments or find a version of the other packages that agrees with the other. Commented Oct 10 at 2:52
  • 2
    if you import one script to another then you can't separate them with different venv. It may work only if you execute other script using subprocess in first script - but this makes problem to communicate between two scripts. Commented Oct 10 at 12:47
  • 1
    Another option would be to take one of the versions of websockets and copy the package content into a renamed private package and use that import where necessary. So you could have websockets 14 and then the contents of 13.1 in a self-made package. But then it becomes a maintenance item. Commented Oct 10 at 17:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.