I'm trying to setup Autobhan Python. I used their suggested installation process:
pip install autobahn[twisted]
and it succeeds: Successfully installed Automat-20.2.0 attrs-22.1.0 autobahn-22.7.1 cffi-1.15.1 constantly-15.1.0 cryptography-38.0.0 hyperlink-21.0.0 idna-3.3 incremental-21.3.0 pycparser-2.21 six-1.16.0 twisted-22.4.0 twisted-iocpsupport-1.0.2 txaio-22.2.1 typing-extensions-4.3.0 zope.interface-5.4.0
And It can be verified in the code, too
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from autobahn import __version__
>>> print(__version__)
22.7.1
However, when I try to run a simple code from the manual:
from autobahn.twisted.component import Component
from autobahn.twisted.component import run
comp = Component(
transports=u"ws://localhost:8080/ws",
realm=u"realm1",
)
@comp.on_join
def joined(session, details):
print("session ready")
if __name__ == "__main__":
run([comp])
It fails because of Import Error:
File "C:\...\site-packages\txaio\tx.py", line 36, in <module>
from twisted.internet.defer import maybeDeferred, Deferred, DeferredList
ImportError: cannot import name 'maybeDeferred' from partially initialized module 'twisted.internet.defer' (most likely due to a circular import) (C:\...\site-packages\twisted\internet\defer.py)
I tried uninstalling everything, installing a fresh Python 3.10, installing a lower version of Autobahn, purging the cache. Nothing works.