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

RuntimeError: There is no current event loop in thread 'MainThread' #929

Open
SnarkBoojum opened this issue May 12, 2022 · 2 comments
Open
Labels

Comments

@SnarkBoojum
Copy link

While trying to update ipykernel's Debian package to 6.13.0, tests were failing with the above error.

I got out of this with:

--- ipykernel.orig/ipykernel/inprocess/client.py
+++ ipykernel/ipykernel/inprocess/client.py
@@ -179,8 +179,7 @@
         stream = kernel.shell_stream
         self.session.send(stream, msg)
         msg_parts = stream.recv_multipart()
-        loop = asyncio.get_event_loop()
-        loop.run_until_complete(kernel.dispatch_shell(msg_parts))
+        asyncio.run(kernel.dispatch_shell(msg_parts))
         idents, reply_msg = self.session.recv(stream, copy=False)
         self.shell_channel.call_handlers_later(reply_msg)

but I'm not sure it's a good solution...

@blink1073
Copy link
Contributor

We've got a good deal of work to do across the board in how we handle event loops, cf jupyter/jupyter_client#755

@blink1073 blink1073 added the bug label May 12, 2022
@bnavigator
Copy link

I saw the same errors in openSUSE and got around this by making sure the testpath is honored (#930 showed me the way).

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

No branches or pull requests

3 participants