Skip to content

AttributeError: module 'geventwebsocket' has no attribute 'create_connection' #100

Description

@vojtooo

I want to connect RPCClient that uses JSONRPCProtocol and HttpWebSocketClientTransport.

I have installed everything using
pip install tinyrpc[websocket]

And then created minimal example

from tinyrpc.client import RPCClient
from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
from tinyrpc.transports.websocketclient import HttpWebSocketClientTransport
from tinyrpc.transports import ClientTransport

def jsonRpcClientProxy(ip, port, one_way=False):
    url = "http://" + str(ip) + ":" + str(port)
    print(url)
    client = RPCClient(JSONRPCProtocol(), HttpWebSocketClientTransport(url))
    return client.get_proxy(one_way=one_way)

When I call jsonRpcClientProxy I get

File "XX.py", line 9, in jsonRpcClientProxy client = RPCClient(JSONRPCProtocol(), HttpWebSocketClientTransport(url)) File "YY/venv/lib/python3.8/site-packages/tinyrpc/transports/websocketclient.py", line 25, in __init__ self.ws = websocket.create_connection(self.endpoint, **kwargs) AttributeError: module 'geventwebsocket' has no attribute 'create_connection'

Is this some library mismatch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions