mandrewcito / signalrcore

SignalR Core python client
https://mandrewcito.github.io/signalrcore/
MIT License
119 stars 57 forks source link

ModuleNotFoundError: No module named 'signalrcore.transport' #56

Closed stsdc closed 3 years ago

stsdc commented 3 years ago

Getting such an error with 0.9.1 when trying to build hub_connection.

Traceback (most recent call last):
  File "./test.py", line 1, in <module>
    from signalrcore.hub_connection_builder import HubConnectionBuilder
  File "/home/stsdc/.local/lib/python3.8/site-packages/signalrcore/hub_connection_builder.py", line 2, in <module>
    from .hub.base_hub_connection import BaseHubConnection
  File "/home/stsdc/.local/lib/python3.8/site-packages/signalrcore/hub/base_hub_connection.py", line 17, in <module>
    from ..transport.websockets.websocket_transport import WebsocketTransport
ModuleNotFoundError: No module named 'signalrcore.transport'
mandrewcito commented 3 years ago

i had forgot the init file on the refactored code, sorry!

Crisgonmu commented 3 years ago

I have the same issue in 0.8.9 version

mandrewcito commented 3 years ago

Update to 0,92 Version its solved on #57

Crisgonmu commented 3 years ago

I have updated to 0.9.2 but now I have a new issue: No module named 'signalrcore.hub.connection_state'

mandrewcito commented 3 years ago

I have created a new venv and download 0.9.2 version.

I run examples/chat.py without problems, what python version do you have?

library installation just instales this requirements :

(venv) XXX @XXX-XXX:~$ pip freeze
certifi==2020.12.5
chardet==4.0.0
idna==2.10
msgpack==1.0.2
pkg-resources==0.0.0
requests==2.25.1
signalrcore==0.9.2
six==1.15.0
urllib3==1.26.3
websocket-client==0.54.0
Crisgonmu commented 3 years ago

I have python 3.7 and it fails trying to execute: from signalrcore.hub.connection_state import ConnectionState

mandrewcito commented 3 years ago

Ah Ok! ,

Library was decoupled (and refactorized) from websockets, on the following versions will support long polling.

Connection state is a "property" from a socket connection so now is placed on

https://github.com/mandrewcito/signalrcore/blob/main/signalrcore/transport/websockets/connection.py

All websocket dependant code is now under transport module:

https://github.com/mandrewcito/signalrcore/tree/main/signalrcore/transport

Crisgonmu commented 3 years ago

Thanks, seems to be working now

Crisgonmu commented 3 years ago

I have a new exception and I think it is related with the refactor, can you check/confirm? The exception is: 'AuthHubConnection' object has no attribute 'hub'

mandrewcito commented 3 years ago

Can you pass the library line that throws that exception? Because test are passing, and auth module coverage is good

Crisgonmu commented 3 years ago

It was my fault, finally I found the line that cause the exception. It was doing this: hub_connection.hub.state but, with the refactor it should be hub_connection.transport.state