2017-03-01 8 views
0

모듈 autobahn-autoreconnect을 사용하고 PyCharm을 사용하여 로컬에서 올바르게 작동합니다. 난 그냥 PyCharm와 모듈을 설치하고 새 것으로 이전 ApplicationRunner 라인 교환 :Python : import autobahn_autoreconnect가 RuntimeError를 발생시킵니다.

# from autobahn.asyncio.wamp import ApplicationRunner 
from autobahn_autoreconnect import ApplicationRunner 

을하지만 다음 pip3 install autobahn-autoreconnect와 우분투 서버에 설치하고 때 다음과 같은 오류 얻으려면, 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

다음 해결책은 나를 위해 일했습니다.

첫째 :

import txaio 
txaio.use_asyncio() 

둘째 :

from autobahn_autoreconnect import ApplicationRunner