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.

RuntimeError: can't register atexit after shutdown

See original GitHub issue

When running a simple vpython script, as I move the mouse across the screen I get a continual stream of these errors:

Task exception was never retrieved
future: <Task finished name='Task-2435' coro=<WSserver.onMessage() done, defined at C:\Users\kg604c\AppData\Roaming\Python\Python310\site-packages\vpython\no_notebook.py:181> exception=RuntimeError("can't register atexit after shutdown")>
Traceback (most recent call last):
  File "C:\Users\kg604c\AppData\Roaming\Python\Python310\site-packages\vpython\no_notebook.py", line 214, in onMessage
    await loop.run_in_executor(None, GW.handle_msg, msg)
  File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 808, in run_in_executor
    executor = concurrent.futures.ThreadPoolExecutor(
  File "C:\Program Files\Python310\lib\concurrent\futures\__init__.py", line 49, in __getattr__
    from .thread import ThreadPoolExecutor as te
  File "C:\Program Files\Python310\lib\concurrent\futures\thread.py", line 37, in <module>
    threading._register_atexit(_python_exit)
  File "C:\Program Files\Python310\lib\threading.py", line 1484, in _register_atexit
    raise RuntimeError("can't register atexit after shutdown")
RuntimeError: can't register atexit after shutdown

This seems to be the same issue as mentioned in #133 however that was a few years ago. I’m unable to downgrade to an older version of python though, is it still something that hasn’t been fixed?

I’m running Python 3.10.0 and VPython 7.6.3

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
BruceSherwoodcommented, May 9, 2022

I happen to be running VPython 7.6.3 with Python 3.9.7, so I will update to 3.10 to see if I can reproduce the error. Thanks for the info.

0reactions
BruceSherwoodcommented, May 16, 2022

I have no idea why that loop was relevant, but should you ever wish to run in jupyter notebook or jupyter lab or Web VPython I think the display will freeze (I know for sure it will freeze in Web VPython). Instead of “pass” use “rate(100)” or similar statement. It happens that of all the various instantiations of VPython, only the “no-notebook” version uses threads, which means that displays can be updated (associated with mousing, for example).

Read more comments on GitHub >

github_iconTop Results From Across the Web

server in a thread (Python3.9.0+aiohttp) : RuntimeError: can't ...
python 3. x - server in a thread (Python3. 9.0+aiohttp) : RuntimeError: can't register atexit after shutdown - Stack Overflow. Stack Overflow for...
Read more >
can't register atexit after shutdown thrown in Python 3.9 #3221
Describe the bug When attempting to create an s3 session resource running on python 3.9 function call throws with message can't register ......
Read more >
runtimeerror: can't register atexit after shutdown - You.com
The fix is to install an older version of autobahn package and txaio. The steps to fix are to uninstall autobahn and txaio....
Read more >
Issue 42647: Unable to use concurrent.futures in atexit hook
RuntimeError: can't register atexit after shutdown What's happening is that the ddtrace library registers an atexit hook that does an HTTP call.
Read more >
[Example code]-server in a thread (Python3.9.0+aiohttp)
Coding example for the question server in a thread (Python3.9.0+aiohttp) : RuntimeError: can't register atexit after shutdown.
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