{"id":28446,"library":"vpython","title":"VPython","description":"VPython is a 3D programming environment for Python, enabling easy creation of navigable 3D animations and simulations. This version (7.6.5) is designed for Jupyter Notebook and requires Python >= 3.7. It uses WebGL for rendering in the browser. Release cadence is irregular, with updates focused on bug fixes and Jupyter compatibility.","status":"active","version":"7.6.5","language":"python","source_language":"en","source_url":"https://github.com/vpython/vpython-jupyter","tags":["3D","animation","education","physics","jupyter","visualization","webgl"],"install":[{"cmd":"pip install vpython","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for Jupyter integration","package":"ipython","optional":false},{"reason":"Required for running in Jupyter Notebook/Lab","package":"jupyter","optional":true}],"imports":[{"note":"Wildcard import can pollute namespace and cause conflicts with other libraries.","wrong":"from vpython import *","symbol":"vpython","correct":"import vpython as vp"},{"note":"Omitting namespace leads to NameError if not imported correctly.","wrong":"canvas()","symbol":"canvas","correct":"scene = vp.canvas()"}],"quickstart":{"code":"import vpython as vp\n\nscene = vp.canvas()\nsphere = vp.sphere(pos=vp.vector(0,0,0), radius=1, color=vp.color.red)\n# To view, run in a Jupyter Notebook cell","lang":"python","description":"Creates a 3D scene with a red sphere. Must be run in a Jupyter Notebook; VPython renders inline."},"warnings":[{"fix":"Migrate to VPython 7 syntax: use 'vpython' module, 'canvas()', 'vector()', and avoid 'visual' module.","message":"VPython 7 is a complete rewrite from VPython 6; the API and rendering engine are entirely different. Code written for VPython 6 (classic) will not work.","severity":"breaking","affected_versions":"7.0+"},{"fix":"Install Jupyter and run code in a notebook cell. Use 'pip install jupyter' then 'jupyter notebook'.","message":"VPython 7 only runs in Jupyter Notebook or JupyterLab (classic). It does not work in other Python IDEs or command-line scripts.","severity":"breaking","affected_versions":"7.0+"},{"fix":"Always run VPython 7 code inside a Jupyter notebook cell.","message":"Running VPython code outside Jupyter (e.g., in a plain Python script) produces no output or error; it silently does nothing.","severity":"gotcha","affected_versions":"7.0+"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Replace 'from visual import *' with 'import vpython as vp' and use vp.canvas(), vp.sphere(), etc.","cause":"VPython 7 replaced the classic 'visual' module with 'vpython'.","error":"ModuleNotFoundError: No module named 'visual'"},{"fix":"Use explicit import: 'import vpython as vp' then 'vp.sphere(...)'.","cause":"When using wildcard import 'from vpython import *', the 'sphere' function exists but may conflict with other names. More commonly, the namespace was omitted.","error":"NameError: name 'sphere' is not defined"},{"fix":"Ensure code runs in a Jupyter notebook cell.","cause":"Attempting to use VPython code outside Jupyter returns None for all objects; arithmetic on None produces this error.","error":"TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}