skip to navigation
skip to content

vpython 7.4.2

VPython for Jupyter Notebook

# VPython

This package enables one to run VPython in a browser, using the GlowScript
VPython API, documented in the Help at If the code is
in a cell in a Jupyter notebook, the 3D scene appears in the Jupyter notebook.
If the code is launched outside a notebook (e.g. from the command line), a
browser window will open displaying the scene.

VPython makes it unusually easy to create navigable real-time 3D animations.
The one-line program "sphere()" produces a 3D sphere with appropriate lighting
and with the camera positioned so that the scene fills the view. It also
activates mouse interactions to zoom and rotate the camera view. This
implementation of VPython was begun by John Coady in May 2014. Ruth Chabay and
Bruce Sherwood are assisting in its further development. The repository for
the source code is at

## Installation

For more detailed instructions on how to install vpython, see, where you will also find a link to the VPython forum, which is the preferred place to report issues and to request assistance.


+ If you use the [anaconda python distribution]( install like this: `conda install -c vpython vpython`
+ If you use any other python distribution, install this way: `pip install vpython`

## Sample program

Here is a simple example:

from vpython import *

This will create a canvas containing a 3D sphere, with mouse and touch
controls available to zoom and rotate the camera:

Right button drag or Ctrl-drag to rotate "camera" to view scene.
To zoom, drag with middle button or Alt/Option depressed, or use scroll wheel.
On a two-button mouse, middle is left + right.
Touch screen: pinch/extend to zoom, swipe or two-finger rotate.

Currently, to re-run a VPython program you need to click the circular arrow icon to "restart the kernel" and then click the red-highlighted button, then click in the first cell, then click the run icon. Alternatively, if you insert "scene = canvas()" at the start of your program, you can rerun the program without restarting the kernel.

Run example VPython programs: [![Binder](](

## vpython build status (for the vpython developers)

[![Build Status](]( [![Build status](](  
File Type Py Version Uploaded on Size
vpython-7.4.2-cp27-cp27m-win32.whl (md5) Python Wheel cp27 2018-03-14 3MB
vpython-7.4.2-cp27-cp27m-win_amd64.whl (md5) Python Wheel cp27 2018-03-14 3MB
vpython-7.4.2-cp34-cp34m-win32.whl (md5) Python Wheel cp34 2018-03-14 3MB
vpython-7.4.2-cp34-cp34m-win_amd64.whl (md5) Python Wheel cp34 2018-03-14 3MB
vpython-7.4.2-cp35-cp35m-win32.whl (md5) Python Wheel cp35 2018-03-14 3MB
vpython-7.4.2-cp35-cp35m-win_amd64.whl (md5) Python Wheel cp35 2018-03-14 3MB
vpython-7.4.2-cp36-cp36m-win32.whl (md5) Python Wheel cp36 2018-03-14 3MB
vpython-7.4.2-cp36-cp36m-win_amd64.whl (md5) Python Wheel cp36 2018-03-14 3MB
vpython-7.4.2.tar.gz (md5) Source 2018-03-14 3MB