我想使用模块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()我做错了什么?
发布于 2017-03-04 17:48:37
下面的解决方案对我很有效。
首先:
import txaio
txaio.use_asyncio()第二:
from autobahn_autoreconnect import ApplicationRunnerhttps://stackoverflow.com/questions/42538364
复制相似问题