Installing iPython Jupyter and iVisual
In a previous post, I described how to install and run VPython using iPython Notebook. However, the previous instructions are now outdated due to the upgrade of Notebook to Jupyter. The instructions below are for Jupyter.
When you install Anaconda, it will automatically install iPython and Jupyter. The only additional package you need for running VPython programs in a notebook is iVisual. Here are the steps to install Anaconda and iVisual (more detailed instructions with screen captures are available):
- Install Anaconda. (http://continuum.io/downloads)
- From a command line, type: pip install ivisual
- From a command line, type: ipython notebook
- The Jupyter home screen will open in your browser. The header of the page is shown below.
- Click the "New" menu and select "Python 2" as shown below.
You will see a header for the new Jupyter notebook as shown below.
- Type the following program into the first cell.
from __future__ import division, print_functionfrom ivisual import *#create scenescene = canvas(title='3D scene')sphere()
You will see a VPython scene with a white sphere as shown below.