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.
: 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.7 or 2.6 from http://www.python.org/download/releases/ (python 3.0 is not yet supported). Make sure it is in your Path (e.g. c:\Python27;c:\Python27\Scripts)
- Download and install the amd64 version of these packages from http://www.lfd.uci.edu/~gohlke/pythonlibs/
- numpy (numpy-mkl build should provide better performance; note: cannot be redistributed without Intel license)
- pyqt (minimal installation ok, provides Qt4)
- mysql-python (optional, only needed if you use MySQL database)
- matplotlib (optional, only needed if you need to create indicator graph)
- Pillow (optional, only needed if you need to create indicator graph)
- h5py (optional, needed for datasets conversion to/from hdf5)
- Install packages below with ez_setup tool easy_install.
- Download and install imagemagick binary 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)
- 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:
- OPUS_DATA_PATH=C:\opus\data (OR other location where you want to put data)
- PATH=%PATH%;C:\Python27 (corresponding to location where Python is installed)
- Open up a command prompt, and type the following, OPUS GUI should start:
C:\> python -m opus_gui.opus
- For additional testing steps, see TestingYourInstallation.
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]:
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.