Registry / ai-ml / vpython

vpython

JSON →
library7.6.5pypypiunverified

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.

pip install vpython
INSTALL
IMPORT
SIG · VPYTHON
V
vpython
ai-mlpythonv7.6.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

vpython
✓ import vpython
✗ import vpython as vp

Creates a 3D scene with a red sphere. Must be run in a Jupyter Notebook; VPython renders inline.

import vpython as vp scene = vp.canvas() sphere = vp.sphere(pos=vp.vector(0,0,0), radius=1, color=vp.color.red) # To view, run in a Jupyter Notebook cell
Debug
Known issues
breakingVPython 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.
fix
Migrate to VPython 7 syntax: use 'vpython' module, 'canvas()', 'vector()', and avoid 'visual' module.
affects: 7.0+
breakingVPython 7 only runs in Jupyter Notebook or JupyterLab (classic). It does not work in other Python IDEs or command-line scripts.
fix
Install Jupyter and run code in a notebook cell. Use 'pip install jupyter' then 'jupyter notebook'.
affects: 7.0+
gotchaRunning VPython code outside Jupyter (e.g., in a plain Python script) produces no output or error; it silently does nothing.
fix
Always run VPython 7 code inside a Jupyter notebook cell.
affects: 7.0+
Upgrade
Version history
7.6.5latest on PyPI · released Mar 26, 2024
Audit
Dependencies
ipythonrequiredRequired for Jupyter integration
jupyteroptionalRequired for running in Jupyter Notebook/Lab
Agent activity
50 hits · last 30 days
node
42
OpenAI (training)
1
Resources
vpython — pip install vpython · libregistry