0

I'm trying to run the turtledemo module on OSX (Ventura 13.3.1).

When I run it, a window appears, but it's unresponsive and the menu items do not work. If I close it manually, the window closes and I get this output:

$ python -m turtledemo
DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
Traceback (most recent call last):
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtledemo/__main__.py", line 398, in <module>
    main()
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtledemo/__main__.py", line 394, in main
    demo = DemoWindow()
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtledemo/__main__.py", line 167, in __init__
    pane.add(self.makeGraphFrame(pane))
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtledemo/__main__.py", line 250, in makeGraphFrame
    turtle.TurtleScreen.__init__(_s_, _s_._canvas)
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtle.py", line 996, in __init__
    self.clear()
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtle.py", line 1028, in clear
    self.onclick(None, btn)
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtle.py", line 1365, in onclick
    self._onscreenclick(fun, btn, add)
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtle.py", line 669, in _onscreenclick
    self.cv.unbind("<Button-%s>" % num)
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/turtle.py", line 422, in unbind
    self._canvas.unbind(*args, **kwargs)
  File "/Users/mkipper/.pyenv/versions/3.9.6/lib/python3.9/tkinter/__init__.py", line 1397, in unbind
    self.tk.call('bind', self._w, sequence, '')
_tkinter.TclError: can't invoke "bind" command:  application has been destroyed

I'm running Python 3.9.6 via pyenv:

$ python -V
Python 3.9.6

I'm tried a bunch of ways to reinstall Python, but nothing seems to have worked. I suspect that the DEPRECATION WARNING is a strong smell here, but not sure how to resolve it. Any ideas are appreciated.

Michael
  • 73
  • 6
  • So when you searched the error message, did [any](https://stackoverflow.com/q/72472167/16775594) [of](https://stackoverflow.com/q/74972873/16775594) [these](https://stackoverflow.com/q/61887110/16775594) help? – Sylvester Kruin Apr 20 '23 at 14:42
  • I recommend to install [the official distribution](https://www.python.org/ftp/python/3.11.3/python-3.11.3-macos11.pkg), and run ```/usr/local/bin/python3```. – relent95 Apr 21 '23 at 05:02

0 Answers0