question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

qasync doesn't work with Python 3.11

See original GitHub issue

After updating to python 3.11 I’m no longer able to launch application:

    qasync.run(main())
  File "/path/venv/lib/python3.11/site-packages/qasync/__init__.py", line 821, in run
    return asyncio.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 93, in run
    raise RuntimeError(
RuntimeError: Runner.run() cannot be called from a running event loop
sys:1: RuntimeWarning: coroutine 'main' was never awaited

Process finished with exit code 1

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
zhusihan-pythoncommented, Dec 21, 2022

i got the same error after set the event loop image maybe its caused by i use QGuiApplication not QApplication

PySide6 support asyncio official recently, here is an example i use the AsyncHelper from it to fix the problem, FYI

1reaction
baha2046acommented, Dec 20, 2022

For me, no problem on 3.11 have you set the event loop at start?

loop = qasync.QEventLoop(app)
asyncio.set_event_loop(loop)
Read more comments on GitHub >

github_iconTop Results From Across the Web

CabbageDevelopment/qasync: Python library for ... - GitHub
qasync allows coroutines to be used in PyQt/PySide applications by providing an implementation of the PEP 3156 event-loop. qasync is a fork of...
Read more >
What's New In Python 3.11 — Python 3.11.1 documentation
This article explains the new features in Python 3.11, compared to 3.10. ... PEP 655: Marking individual TypedDict items as required or not-required....
Read more >
asyncio — Asynchronous I/O — Python 3.11.1 documentation
asyncio provides a set of high-level APIs to: run Python coroutines concurrently and have full control over their execution;. perform network IO and...
Read more >
Python Release Python 3.11.1
Python 3.11.1 is the newest major release of the Python programming language, and it contains many new features and optimizations.
Read more >
Python Release Python 3.11.0
Python 3.11.0 is the newest major release of the Python programming language, and it contains many new features and optimizations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found