Python:import autobahn_autoreconnect导致运行时错误
我想使用这个模块,它在PyCharm本地运行良好。我只需使用PyCharm安装模块,并将旧的Python:import autobahn_autoreconnect导致运行时错误,python,ubuntu,python-import,autobahn,reconnect,Python,Ubuntu,Python Import,Autobahn,Reconnect,我想使用这个模块,它在PyCharm本地运行良好。我只需使用PyCharm安装模块,并将旧的ApplicationRunner行与新行交换: # from autobahn.asyncio.wamp import ApplicationRunner from autobahn_autoreconnect import ApplicationRunner 但是,当我在Ubuntu服务器上用pip3安装autobahn autoreconnect并使用导入autobahn\u autoreconn
ApplicationRunner
行与新行交换:
# from autobahn.asyncio.wamp import ApplicationRunner
from autobahn_autoreconnect import ApplicationRunner
但是,当我在Ubuntu服务器上用pip3安装autobahn autoreconnect
并使用导入autobahn\u 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()
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/usr/local/lib/python3.5/dist-packages/autobahn\u autoreconnect/\uuuuuuu init\uuuuu.py”,第31行,在
来自autobahn.wamp导入协议
文件“/usr/local/lib/python3.5/dist-packages/autobahn/wamp/protocol.py”,第272行,在
类应用程序会话(基本会话):
文件“/usr/local/lib/python3.5/dist packages/autobahn/wamp/protocol.py”,第277行,在ApplicationSession中
log=txaio.make_logger()
文件“/usr/local/lib/python3.5/dist-packages/txaio/_unframework.py”,第43行,输入使用错误
要使用txaio,必须首先选择一个框架
RuntimeError:要使用txaio,必须首先选择一个框架,使用.use_twisted()或.use_asyncio()
我做错了什么?以下解决方案对我有效 第一:
import txaio
txaio.use_asyncio()
第二:
from autobahn_autoreconnect import ApplicationRunner