reachy-sdk icon indicating copy to clipboard operation
reachy-sdk copied to clipboard

Compatibility with Python 3.10

Open nathansegers opened this issue 2 years ago • 2 comments

If the reachy-sdk Python package is installed into a fresh Conda environment with Python 3.10, we get this error:

TypeError: As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary

The whole stack trace is:

File "C:\Users\natha\.conda\envs\reachy-sdk\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\site-packages\reachy_sdk\reachy_sdk.py", line 176, in _start_sync_in_bg
    loop.run_until_complete(self._sync_loop())
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\site-packages\reachy_sdk\reachy_sdk.py", line 231, in _sync_loop
    await asyncio.gather(
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\site-packages\reachy_sdk\reachy_sdk.py", line 220, in _stream_commands_loop
    await joint_stub.StreamJointsCommands(command_poll())
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\site-packages\grpc\aio\_channel.py", line 196, in __call__
    call = StreamUnaryCall(request_iterator, deadline, metadata,
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\site-packages\grpc\aio\_call.py", line 593, in __init__
    self._init_stream_request_mixin(request_iterator)
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\site-packages\grpc\aio\_call.py", line 374, in _init_stream_request_mixin
    self._metadata_sent = asyncio.Event(loop=self._loop)
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\asyncio\locks.py", line 167, in __init__
    super().__init__(loop=loop)
  File "C:\Users\natha\.conda\envs\reachy-sdk\lib\asyncio\mixins.py", line 17, in __init__
    raise TypeError(

So it seems this has to do with asyncio.

nathansegers avatar Nov 16 '21 14:11 nathansegers