![]() |
Installing VPython on Mac OSX 10.3 or later running X11 |
![]() |
If you are running Leopard (OS X 10.5) on an Intel Mac, and you don't intend to use the Fink package manager for anything other than installing VPython, you can use the quick and easy VPython installer VPython3.2.11_IntelOSX_5.pkg prepared by John Armstrong.
This installer creates a folder /sw containing just those Fink packages needed for VPython (Python 2.5, the Visual module, and the Numeric module, for a total download file of 23 MB).
The installer also creates in the Applications folder a convenient VPython icon for starting up the IDLE program editor. The File open menu offers you many demo programs you can run.
Before running VPython programs, go to the X11 preferences, and in the Input section choose "Emulate three button mouse", in order to be able to rotate (Command-drag) and zoom (Option-drag).
There is now an up-to-date Fink package for VPython installable on OSX 10.3 or later.
The following instructions usually work. More detailed instructions are provided by Danny Caballero.
1) Make sure you have installed X11 and the Xcode package:
On OSX 10.5, X11 is automatically installed.
Otherwise, scroll down on the installer DVD to "Optional Installs" and install X11.
Also, you need to install the XCode package from the installer DVD.
2) Use fink (a program used to install Unix-based OSX applications) to install VPython:
Download fink from http://fink.sourceforge.net for your version of OSX.
Copy Fink Commander from the installer package to your disk for future use.
Run Fink Commander and do the following operations:1) Source > Scanpackages.
You will be asked twice to enter your password.
2) Source > Utilities > Index.
3) Source > Selfupdate-rsync.
This takes several minutes. Click Submit when asked.
4) Scroll to visual-py24 and select it. (If you want to use Python 2.5, see below.)
NOTE: It is possible for the list of programs to disappear upon resizing the window or moving the
nearly invisible divider of the scroll area up within the window. This might make you think the
program isn't available.
5) Binary > Install.
This takes several minutes.
You must enter the following into an X Terminal window, not the standard Terminal program.
>> /sw/bin/vpython2.4
This starts IDLE, and on the file menu you can choose an example program to run.
On the Run menu, choose Run Module or press fn-F5.
After starting IDLE, on the file menu you can choose an example program to run.To zoom, hold down the Command key (Apple key) and the mouse button (emulating "right mouse button").
To rotate the camera angle, hold down the Option key and the mouse button (emulating "middle mouse button").If there is no /sw/bin/vpython2.4, execute the following commands (or create a shell script containing these statements):
cd /sw/lib/python2.4/site-packages/visual/examples
/sw/bin/python2.4 /sw/lib/python2.4/idlelib/idle.pyw
To customize IDLE:
To add the Visual documentation to the help menu, choose Options > Configure IDLE.
Choose General.
Click Add.
For Menu item, enter Visual.
For Help file path, enter file:///sw/share/doc/visual-py24/index.html (or visual-py23 for Python 2.3).
You may find it useful to change the default behavior of IDLE. In
Configure IDLE, click General, and specify "Open Edit Window" and "No Prompt".
With "No Prompt", you will be prompted to save a new file the first time you run,
but your file will be automatically saved on all later runs.
Warning: this procedure takes a VERY long time; try this only if the binary install doesn't work.
If necessary, set Fink to use the "unstable" packages. There are two ways to do this:Method 1. In Fink Commander, from the FinkCommander menu, choose Preferences.
Choose the Fink tab, and check the boxes for "Use unstable packages". Click "Apply". Wait for processing to finish (“barber pole” stops spinning).Method 2. Edit the file /sw/etc/fink.conf. Add unstable/main to the "Trees:" line.
Note: unstable packages are newer versions that have not yet been moved into the "stable" releases. They may not really be any buggier than the "stable" packages. If you have a real reason to avoid updating all packages with new ("unstable") versions, then see:
http://fink.sourceforge.net/faq/usage-fink.php#unstable
for instructions on how to update only selected packages.
Quit Fink Commander. Run Terminal (in the Applications > Utilities folder) and type this:
This process takes a long time. The "-y" option makes default choices, which is fine and means you don't have to keep entering "y" during the lengthy process.
Next, in a Terminal window type this:
>> /sw/bin/fink install visual-py25
This process takes a very long time. It has to compile a large number of programs. If at some later time you want to install a newer version of visual-py25 it will not take long.
See above to run VPython.