VPython on Windows

The ready-built Windows installer provided by VPython themselves is not compatible with Canopy's directory structure. However a Python community member, Chris Gohlke at UCI, has a great project of providing hundreds of scientific Python pre-built packages for Windows, including VPython. Here is the link to his VPython builds: http://www.lfd.uci.edu/~gohlke/pythonlibs/#vpython. Be sure you download one of the installers for Python 2.7 (64-bit or 32-bit depending on your Canopy installation).


To install Gohlke's VPython into Canopy, do the following:

1) From the Canopy Preference menu, set Canopy to be your default Python. (For more on this, see "Make Canopy User Python be your default Python", section "Set Canopy Preference".

2) From the Canopy Tools Menu (or the Windows Start Menu), open a Canopy Command Prompt window. Type the following command:
python -c "import sys; print sys.prefix"
and confirm that the output is:
c:\Users\<your-user-name>\AppData\Local\Enthought\Canopy\User

(or Canopy32 for a 32-bit Canopy)

3) Run Gohlke's VPython installer.

4) Type ipython, then at the Ipython prompt type from visual import *.
If this import succeeds, then VPython is installed in Canopy.

Note that VPython assumes but does not require the use of IDLE, the very rudimentary IDE that ships with Python itself. Instead, we recommend using the Canopy GUI, as it does everything that IDLE does, and much more. Depending on your use of VPython, you might need to change one Canopy preference: set Python / Pylab backend to "Inline (SVG)".

Have more questions? Submit a request

Comments

  • Avatar
    Robert Hamill

    I am studying Allen B. Downey's, "Think Complexity." His boid example uses vpython.

Powered by Zendesk