Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10. #216

Open
ajs256 opened this issue Jul 21, 2021 · 8 comments

Comments

@ajs256
Copy link

ajs256 commented Jul 21, 2021

When attempting to run the "hello world" program, I get this warning:

~/code/cozmo_sdk_examples_1.4.10/tutorials/01_basics $ python 01_hello_world.py
/usr/local/lib/python3.9/site-packages/cozmo/event.py:488: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.

(python is aliased to python3 in my system)

@yolepro
Copy link

yolepro commented Nov 1, 2021

Hello,
I have the same issue and now it is not a warning anymore but a blocking point.
I am using Python 3.10 on a Macbook.
Here is the error message I get when executing the hello world:

Traceback (most recent call last):
  File "/Users/yoann/Dev/workspaces/cozmo/cozmo_sdk_examples_1.4.10/tutorials/01_basics/01_hello_world.py", line 29, in <module>
    cozmo.run_program(cozmo_program)
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 849, in run_program
    connect(wrapper, conn_factory=conn_factory, connector=connector)
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 605, in connect
    return _connect_sync(f, conn_factory, connector)
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 527, in _connect_sync
    coz_conn = lt.start()
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 468, in start
    raise coz_conn
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 450, in run_loop
    coz_conn = connect_on_loop(self.loop, self.conn_factory, self.connector)
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 569, in connect_on_loop
    transport, coz_conn = loop.run_until_complete(connect())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
    return future.result()
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 567, in connect
    return await connector.connect(loop, factory, conn_check)
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 377, in connect
    android_result = await self._do_connect(self.android, *conn_args)
  File "/Users/yoann/Library/Python/3.10/lib/python/site-packages/cozmo/run.py", line 364, in _do_connect
    result = await asyncio.gather(connect, loop=loop, return_exceptions=True)
TypeError: gather() got an unexpected keyword argument 'loop'
sys:1: RuntimeWarning: coroutine 'AndroidConnector.connect' was never awaited

Any advice?

@G-11-P
Copy link

G-11-P commented Nov 10, 2021

Thanks

@JFIUG
Copy link

JFIUG commented Nov 20, 2021

one day i also got it

@JFIUG
Copy link

JFIUG commented Nov 20, 2021

try:

py -m flask run

@JFIUG
Copy link

JFIUG commented Nov 20, 2021

first you do the flask app i forgor💀

@porplax
Copy link

porplax commented Jun 8, 2022

Solution: Downgrade to 3.8 or earlier. I'm unsure of how else anyone would solve the issue however :/

@SRamezanH
Copy link

remove loop=loop, in line 364 of run.py and , loop=self._loop in line 488 of event.py. It wil fix everything.

SRamezanH pushed a commit to SRamezanH/cozmo-python-sdk that referenced this issue Aug 22, 2022
Paillat-dev added a commit to cozmoroot/cozmo-python-sdk that referenced this issue Aug 1, 2023
@Rafaelko11
Copy link

Rafaelko11 commented Jan 2, 2024

remove loop=loop, in line 364 of run.py and , loop=self._loop in line 488 of event.py. It wil fix everything.

Where do I change these ones ?
I can't find package folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants