Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python:import autobahn_autoreconnect导致运行时错误_Python_Ubuntu_Python Import_Autobahn_Reconnect - Fatal编程技术网

Python:import autobahn_autoreconnect导致运行时错误

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

我想使用这个模块,它在PyCharm本地运行良好。我只需使用PyCharm安装模块,并将旧的
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