Running Opus & UrbanSim on 64 Bit Machines
Running UrbanSim with 64 bit Python on Windows
Given the memory limit of Python on 32 bit Windows computer, it may be desirable to run UrbanSim in a 64 bit environment. These are the steps to set up a 64 bit environment for Opus/UrbanSim.
Requirement: A computer with 64 bit CPU and plenty of memory (>=4G), with a 64 bit version of Windows operation system installed, e.g. Windows XP 64 bit, Windows 7 64 bit, etc. We recommend a clean opus installation and the Opus Installer (which is strictly for 32 bit system at this moment) should not be used.
Install Python and Required Packages
- Download and install the X86_64 bit version of Python 2.6 from http://www.python.org/download/releases/ (opus 4.4.0 works on python 2.7, but python 3.0 is not yet supported.)
- Download and install the amd64 version of these packages from http://www.lfd.uci.edu/~gohlke/pythonlibs/
- numpy
- scipy
- PyQt4
- lxml
- MySQLdb (optional, only needed if you use MySQL database)
- Matplotlib (optional, only needed if you need to create indicator graph)
- PIL (optional, only needed if you need to create indicator graph)
- setuptools (optional, only needed if you use setuptools to install packages in the next step)
- Install packages below with ez_setup tool easy_install. Or install the Base distribution from http://www.lfd.uci.edu/~gohlke/pythonlibs/, which includes these packages and many more.
- Download and install imagemagick from http://www.imagemagick.org/script/download.php (optional, only needed if you're going to create animated maps)
- packages yet to have a 64 bit binary installer:
- mapnik (which means map indicators won't work) (optional, only needed if you're going to create maps using mapnik)
Install OPUS
- Download opus source code and data from here (including sample data, 125MB in size) and unzip it to your local hard disk, say C:\opus. Alternatively, you can check out data, project_configs, settings, and src/trunk with a svn client from https://svn.urbansim.org
- Set up Windows environment variables:
- PYTHONPATH=C:\opus\src
- OPUS_HOME=C:\opus
- OPUS_DATA_PATH=C:\opus\data (OR other location where you want to put data)
- PATH=%PATH%;C:\python26
Test installation
- Open up a command prompt, and type the following, OPUS GUI should start:
C:\> python -m opus_gui.opus
Setting up Eclipse 64bit for development on Windows
This page has good instructions for downloading and setting up 64bit Eclipse for Python development with additional instructions for setting up SVN access:
Setting up PyDev and SVN on Eclipse 64 bit
These instructions have been tested on 64 bit versions of Windows XP64 and Windows 7 64.
Fix "ValueError: Invalid index type"
(Update: this fix is not required for scipy version >=0.8)
We have successfully run Opus & UrbanSim on 64 bit machines; although this has been tested much less extensively than running on 32 bit machines.
There is one patch that is currently needed to run on 64 bit machines, due to a bug in scipy. During excution of the household transition model, something like this error will occur:
File "/usr/lib/python2.5/site-packages/scipy/ndimage/measurements.py", line 124, in sum
raise ValueError("Invalid index type")
ValueError: Invalid index type
The current workaround is to edit the line immediately above the raise in scipy/ndimage/measurements.py to read:
numpy.uint8, numpy.uint16, numpy.bool, numpy.int64]:
rather than:
numpy.uint8, numpy.uint16, numpy.bool]:
If the package is installed in a
virtual Python environment, the source file can be modified without requiring root privileges and without affecting other software installed on the system.