You are here: Download Web>MacintoshInstallation (21 Sep 2010)

Installing Opus/UrbanSim on Macintosh

These following instructions are for installing Opus/UrbanSim on Macintosh OS X. Unfortunately there isn't an installer for the Mac, so you'll need to install the necessary packages separately, in some cases building them from source. The following directions use Python version 2.6.

Installing python packages can be finicky on Macs unless a dmg file is available. These instructions have been tested on Leopard, but your system may differ, and it may be necessary to explore other ways to install python packages on your computer. Please also see the MacintoshInstallationHints page for suggestions.

Prerequisites

Install the following applications if you don't have them already:
  • XCode. This comes as an optional install on the Leopard Install disks. You should download the latest available version. This is a ~900mb download.
  • Qt. Get the LGPL version of the framework only.
  • Optional: MySQL; also MySQL Workbench for a GUI browser and administration of MySQL. There is more information on installing MySQL on InstallingMySQL.

Installing Python

Download python2.6 from the downloads section of the python website. (These directions were tested with Python 2.6.5; other 2.6 Pythons will probably work as well.) Once downloaded, double click the Python.mpkg file to install.

After installing, you can verify the install was successful by opening up a terminal and typing

which python

should say something like

/Library/Frameworks/Python.framework/Versions/2.6/bin/python

Installing Python Packages

The following packages for Python 2.6 are required:

  • numpy
  • scipy
  • lxml
  • sqlalchemy
  • elixir

These packages are optional (see Required Packages for details when they are needed):

  • matplotlib
  • pil
  • pyqt4
  • mapnik
  • dbfpy
  • MySQL-python (if you are using MySQL)
  • rpy2 (if you are using R)

See MacintoshInstallationHints for hints on installing these packages. Generally, you should use dmg files whenever available. Sometimes easy_install will work (but use a dmg file instead, when possible), and sometimes you'll need to explicitly build from source and maybe apply a patch.

Installing Opus and Urbansim

Follow these directions: DownloadingSampleDataAndSourceCode

Defining Environment Variables

UrbanSim requires the following environment variables. The first tells the Python interpreter where to find the Opus/UrbanSim code. The second tells the system where to find your cached data and configurations.

  • PYTHONPATH - This environment variable tells Python where to look for files outside of Python's 'site-packages' directory (which is the default location for Python installers). Change PYTHONPATH to include the path to the directory containing the packages opus_core, urbansim, and so forth, that you downloaded in the previous step.
  • OPUS_HOME - The Opus home directory (surprise). This includes subdirectories with sample data for Eugene and Seattle projects, output from runs, template configurations for running simulations using these projects, and probably your source code and documentation. This is the directory you downloaded from the zip file and installed in the previous step. So if you put this unzipped directory just in your home directory, set this variable to /Users/yourname/opus.
Optionally, depending on what you are using and where you store your data, you might want to set this variable as well.
  • OPUS_DATA_PATH (optional) - The directory where you keep your sample data and caches of data for particular runs. It defaults to the data subdirectory under OPUS_HOME, so if you leave the data at the default location from the zip file, don't set this variable.
See MacintoshInstallationHints for information on defining environment variables on the Mac.

Testing Your Installation

To test if your installation was successful, in a shell, navigate to the opus_gui project and type python opus.py. This should start up the GUI. Then do File, Open Project, and select the eugene_gridcell project. In the Scenarios tab of the GUI, select the Eugene_baseline scenario, right-click, and run. Click the start run button and if this completes, you should have a working install.

-- AlanBorning - 23 May 2010

Topic revision: r8 - 21 Sep 2010 - 12:25:34 - HanaSevcikova
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback