vpython / vpython-jupyter

3D visualization made easy
MIT License
138 stars 64 forks source link

"Task exception was never retrieved" upon moving mouse in browser canvas #133

Closed jacobsandersen closed 3 years ago

jacobsandersen commented 3 years ago

When running a program that uses vpython from an IDE like PyCharm, the program output spits errors when moving the mouse around the browser canvas where the vpython output is located.

I am simply using this program:

from vpython import *
a = arrow(pos=vector(1, 1, 5), color=vector(255, 52, 32))

When I run the program, a browser window opens with the arrow at the specified position. When I move my mouse around, I am spammed with errors like these (all the same error):

Task exception was never retrieved
future: <Task finished name='Task-17' coro=<WSserver.onMessage() done, defined at /home/simple/.local/lib/python3.9/site-packages/vpython/no_notebook.py:156> exception=RuntimeError("can't register atexit after shutdown")>
Traceback (most recent call last):
  File "/home/simple/.local/lib/python3.9/site-packages/vpython/no_notebook.py", line 189, in onMessage
    await loop.run_in_executor(None, GW.handle_msg, msg)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 809, in run_in_executor
    executor = concurrent.futures.ThreadPoolExecutor(
  File "/usr/lib/python3.9/concurrent/futures/__init__.py", line 49, in __getattr__
    from .thread import ThreadPoolExecutor as te
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 37, in <module>
    threading._register_atexit(_python_exit)
  File "/usr/lib/python3.9/threading.py", line 1370, in _register_atexit
    raise RuntimeError("can't register atexit after shutdown")
RuntimeError: can't register atexit after shutdown

I saw another issue (#14) about this being related to zooming, but I figured this was a novel issue as it happens when simply moving my cursor around.

I'm running on Arch Linux, Python 3.9, PyCharm 2020.3, and Firefox 83.0.

Is this fixable?

jacobsandersen commented 3 years ago

Okay, weird. When I run it with the python console everything is fine apparently...

BruceSherwood commented 3 years ago

We are behind. The builds for 7.6.1 were done for Python 3.6, 3.7, and 3.8, not 3.9. So it might be that it would work if you downgraded Python.

Bruce

jacobsandersen commented 3 years ago

We are behind. The builds for 7.6.1 were done for Python 3.6, 3.7, and 3.8, not 3.9. So it might be that it would work if you downgraded Python. Bruce

You're correct, thanks! I downgraded to 3.8.6 and it worked.