Installing Pyro on a Mac

These instructions explain how to get a basic Pyro installation running under Mac OS X. Unfortunately, I ran into trouble when trying to build the vision code (which supports image processing in Pyro) on my Mac. Pyro's vision code is all implemented as Python-wrapped C++ code for speed (using something called SWIG), and when I tried building it, my compiler choked. My Mac's C++ compiler must not be the right version, but I don't currently know how to resolve the issue. So for now, unless I (or one of you) figure something out, you won't be able to use cameras or visual processing with Pyro on the Mac. However, you don't need vision support for the current homework assignment.

To install Pyro, follow these steps. This is what I did to install Pyro on my Mac. If something doesn't work for you or is unclear, let me know.

Note: these instructions are for Python version 2.4.4. Version 2.5 (the latest) seems to cause compiler problems. If you are running 2.5, I would suggest uninstalling it and installing 2.4.4 instead.

To build Pyro, you will need to have the Xcode Developer Tools installed. These are usually included with your Mac as a separate set of CD-ROMs.

1. Install Numeric and PIL

  1. Download Numeric-24.2-py2.4-macosx10.4.zip. Open the downloaded folder, double-click the .mpkg file, and accept the installation defaults.

  2. Start Python and type "import Numeric" to verify that it installed correctly. If so, you won't see any error messages.

  3. Next, download and install PIL-1.1.5-py2.4-macosx10.4.dmg.

  4. Start Python and type "import PIL" to verify that it installed correctly.

2. Install Pyro

  1. Open a Terminal (command-line) window and verify that CVS is installed by typing which cvs. You should see something like:

    /usr/bin/cvs
    

    If you get the message "No cvs found in ...", make sure you have the Xcode Developer Tools installed (CVS is included with them), and that /usr/bin is in your path.

  2. Change to Python's site-packages subdirectory (where it expects third-party software packages to live) by typing:

    cd /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
    
  3. Next, we need to retrieve the Pyro software from its CVS repository at Bryn Mawr College. First, type the following command. When prompted for a password, just hit Return.

    cvs -d :pserver:anonymous@cvs.cs.brynmawr.edu/cvs login
    
  4. The next command copies all of Pyro's files to a subdirectory called pyrobot. Since write permission is required to create the directory, we run the command using sudo (type your password when prompted).

    sudo cvs -d :pserver:anonymous@cvs.cs.brynmawr.edu/cvs co pyrobot
    
  5. Now change to the pyrobot subdirectory.

    cd pyrobot
    
  6. Before we can build Pyro, we have to configure it. Type the following command and answer the questions as shown below.

    sudo python ./configure.py
    

  7. Now build it!

  8. sudo make clean
    sudo make
    
  9. Make sure that no errors occurred in the previous step. If everything worked, congratulations, you should have a running version of Pyro (without camera/vision support). To start Pyro, type the following command in the pyrobot subdirectory:

    bin/pyrobot
    
  10. To be able to run Pyro from any subdirectory, do the following.

    1. Create a symbolic link in your /usr/bin subdirectory to Pyro's executable:

      cd /usr/bin
      sudo ln -s /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pyrobot/bin/pyrobot .
      
    2. Add the following line to your ~/.bash_profile file (or ~/.profile if you don't see ~/.bash_profile when you type ls -a ~):

      export PYROBOT=/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pyrobot
      
    3. Save your changes and then type source ~/.bash_profile at the command prompt.

  11. Verify that everything works:

    cd
    pyrobot