3

I work with Python 3.10.0. I installed vpython using pip, it was installed successfully.

Then when I just use:

from vpython import *

print('hello')

hello is printed, and after that I get the following Error:

exit
Exception ignored in atexit callback: <function Exit at 0x1095d4ee0>
Traceback (most recent call last):
  File "/Users/.../.pyenv/versions/3.10.0/lib/python3.10/site-packages/vpython/vpython.py", line 22, in Exit
    a = 1.0/zero
ZeroDivisionError: float division by zero

What does this mean? What can I do?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • 2
    The code causing this exception was added to vpython [here](https://github.com/vpython/vpython-jupyter/commit/5051943529c88638893b7653c527e7ce56504ab3). I have no idea how this is supposed to make sense. – mkrieger1 Jul 22 '22 at 17:21
  • Any idea what can I do? – user2169778 Jul 23 '22 at 22:34
  • That statement (a = 1.0/zero) is inside a function named "exit" which facilitates killing a running VPython program in some situations. When I try your simple program, it works, whether starting from IDLE or from a terminal or in a Jupyter notebook. How are you launching the program? On what platform? With what browser? – user1114907 Jul 24 '22 at 03:05
  • I work with visual studio code , run it the terminal from visual , Python 3.10.0 63-bit (3.10.0: pyenv) on mac with Monterey OS – user2169778 Jul 24 '22 at 05:15
  • 1
    Ah, now I see. In the particular case of running from a terminal, you need to add the following to the end of your program: while True: rate(60) In other environments this ending loop is unnecessary. – user1114907 Jul 24 '22 at 23:27

1 Answers1

0

vpython 7.6.4 throws the ZerodivisionError

but installing the version of 7.6.1 will resolve this issue. pip install vpython==7.6.1