我想使用模块autobahn-autoreconnect,它可以在本地使用PyCharm。我只是用PyCharm安装模块并用新的ApplicationRunner
行交换:
# from autobahn.asyncio.wamp import ApplicationRunner
from autobahn_autoreconnect import ApplicationRunner
但是当我使用pip3 install autobahn-autoreconnect
将其安装在Ubuntu服务器上然后只使用import autobahn_autoreconnect
时,我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/autobahn_autoreconnect/__init__.py", line 31, in <module>
from autobahn.wamp import protocol
File "/usr/local/lib/python3.5/dist-packages/autobahn/wamp/protocol.py", line 272, in <module>
class ApplicationSession(BaseSession):
File "/usr/local/lib/python3.5/dist-packages/autobahn/wamp/protocol.py", line 277, in ApplicationSession
log = txaio.make_logger()
File "/usr/local/lib/python3.5/dist-packages/txaio/_unframework.py", line 43, in _throw_usage_error
"To use txaio, you must first select a framework "
RuntimeError: To use txaio, you must first select a framework with .use_twisted() or .use_asyncio()
我做错了什么?
答案 0 :(得分:0)
以下解决方案适合我。
首先:
import txaio
txaio.use_asyncio()
第二
from autobahn_autoreconnect import ApplicationRunner