{"id":22463,"library":"tkinter-gl","title":"tkinter-gl","description":"A base class for GL rendering surfaces in tkinter, enabling OpenGL integration with Tkinter GUIs. Current version 1.1, supports Python >=3.8. Low release cadence.","status":"active","version":"1.1","language":"python","source_language":"en","source_url":"https://github.com/3-manifolds/tkinter_gl","tags":["tkinter","opengl","gui","graphics"],"install":[{"cmd":"pip install tkinter-gl","lang":"bash","label":"pip"}],"dependencies":[{"reason":"Required for OpenGL functionality.","package":"PyOpenGL","optional":false}],"imports":[{"note":"Class is named GLCanvas, not Canvas.","wrong":"from tkinter_gl import Canvas","symbol":"GLCanvas","correct":"from tkinter_gl import GLCanvas"}],"quickstart":{"code":"import tkinter as tk\nfrom tkinter_gl import GLCanvas\n\nroot = tk.Tk()\ncanvas = GLCanvas(root, width=400, height=400)\ncanvas.pack()\nroot.mainloop()","lang":"python","description":"Minimal example creating a GLCanvas inside a Tkinter window."},"warnings":[{"fix":"Install PyOpenGL with compatible wheel for ARM.","message":"GLCanvas may not work on ARM Macs without proper PyOpenGL installation. Use pip install PyOpenGL PyOpenGL_accelerate.","severity":"gotcha","affected_versions":"all"},{"fix":"Add root.update() after creating the canvas but before making GL calls.","message":"On Linux, GLCanvas may require the Tkinter window to be realized before OpenGL calls work. Ensure you call root.update() or wait for the window to appear.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure you have installed tkinter-gl (pip install tkinter-gl) and the correct import is from tkinter_gl import GLCanvas.","cause":"Installed version is older than 1.0 (if any) or package not installed.","error":"ImportError: cannot import name 'GLCanvas' from 'tkinter_gl'"},{"fix":"Install PyOpenGL: pip install PyOpenGL","cause":"PyOpenGL is not installed.","error":"ModuleNotFoundError: No module named 'OpenGL'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}