Running UrbanSim? in Eclipse on Ubuntu 10.04 (lucid lynx)
Install ubuntu lucid from CD and make sure that eclipse (in this case version 3.5.2) is installed.
Preliminary Installations
Install the following packages using console:
sudo apt-get install python-qt4 libxslt1.1 python-lxml python-sqlalchemy python-elixir python-matplotlib python-mapnik python-mysqldb python-rpy python-scipy openjdk-6-jre eclipse python-virtualenv python-dev python-psycopg2 python-qscintilla2
This also installs scipy in version 0.7.0, which is slightly less than recommended by
UrbanSim? (0.7.2), but works fine.
As of 2010-12-22, there is no packaged version of scipy 0.7.2 available on the Ubuntu archives.
We suggest installing scipy 0.7.0 using apt-get.
scipy 0.7.2 may be installed later from source into a virtual environment.For installing scipy from source using easy_install, install also the following packages:
sudo apt-get install libatlas-base-dev libumfpack5.4.0 libsuitesparse-dev swig python-nose
Install eclipse if it is not yet on your system.
Install Pydev in eclipse
Install Pydev in eclipse
- Menu <Help>, <Install New Software>
- <Add>
- In window 'Add Site' enter
- Name: Pydev and Pydev Extensions
- Location: http://pydev.org/updates (alternative might be http://pydev.sourceforge.net/updates
- <ok>
- Choose this site; packages 'Pydev' and 'PyDev Mylyn Integration' should appear
- check both folders and confirm <NEXT>
- accept the terms of license and confirm <finish>
For additional information or problems see
http://www.pydev.org/manual_101_install.html
Install Virtual Environment for Python
Follow:
http://www.urbansim.org/Download/PythonVirtualenv (if no more available see APPENDIX_2_installing_python_virtual_env.txt)
Pay attention on what commands you do with sudo rights!
Install dbfpy
with easy_install in console inside the virtual environment:
(opus-env) $ easy_install
http://sourceforge.net/projects/dbfpy/files/dbfpy/2.2.4/dbfpy-2.2.4.tar.gz/download(DO NOT use sudo here -- if easy_install says that it cannot install, you need to activate your virtual environment first!)
Optional: For installing scipy-0.7.2 using easy_install type in console inside the virtual environment:
easy_install
http://sourceforge.net/projects/scipy/files/scipy/0.7.2/scipy-0.7.2.tar.gz/downloadTest the installation of scipy:
sudo apt-get install python-nose
python
>>> import scipy;
>>> scipy.test()
Examine errors and failures reported by this test. (Output might look different if you installed scipy-0.7.2 instead of 0.7.0)
Install Subversive in eclipse
-
Start eclispe
-
Go to workbench
-
Menu <Help>, <Install New Software>, <Add>
-
Enter in Window "Add Site":
Name:<Subversive SVN Connectors Site>
Location:<http://community.polarion.com/projects/subversive/download/eclipse/archive/I20091009-1900/>
confirm with <OK>
-
In window "Install": Work with: Subversive SVN Connectors Site
-
Open folder "Subversive SVN Connectors" and uncheck all "JavaHL-win32-packages" (there should be three of them),
-
Check all other packages in Subversive SVN Connectors,
-
Check folder of Subversive SVN Connectors Sources, <NEXT>, accept license agreement, <Finish>, restart eclipse
-
Go to workbench again
-
Menu <Help>, <Install New Software>,
-
choose from dropdown-menu "Galileo Update Site - http://download.eclipse.org/releases/galileo/",
-
open folder collaboration and check "Subversive SVN Integration for the Mylyn Project" <NEXT>,
-
accept license agreement, <Finish>, restart eclipse
-
Check installed software: <Help>, <About Eclipse SDK>, <Installation Details>, <Installed Software>
You should see at least:
Eclipse Platform
PyDev for Eclipse
Pydev Mylyn Integration
Subversive SVN Connectors
Subversive SVN Integration for the Mylyn Project
Subversive SVN Team Provider
SVNKit 1.3.0 Implementation
Configure Eclipse to use the Python interpreter of the Virtual Environment
1. <Window>, <Preferences>,
2. Open folder Pydev click on "Interpreter Python"
3. <New> and give a name, eg. "Python 2.6 VE"
4. browse for home/<username>/opus_env/bin/python2.6
5. confirm with <ok>
6. keep default settings and confirm with <ok>
Connect to the OPUS Subversive repository
1. <Window>, <Open Perspective>, <Other>, choose: <SVN Repository Exploring> confirm with <ok>
2. Right click in pane SVN Reposiories, <New>, <Repository Location>
3. Enter URL:
https://svn.urbansim.org confirm with <ok>
Create new Project
1.go to Pydev perspective (<Window>, <Open Perspective>, <Other>, <Pydev>)
2.rightclick in Pydev-explorer pane on left side
3.choose <new>, <Project>
4.project wizard should appear
5.select in folder <Pydev>, <Pydev-project>, <NEXT>
6.enter a project name, e.g. "UrbanSim"
7.grammar version should be 2.6 by default
8.choose interpreter (created before, see above) from dropdown-menu, e.g. "Python 2.6 VE"
9.ok
10.in "Pydev Package Explorer", delete the newly created "src" folder
Import Urbansim sources from SVN into the above created Project
1.go into Pydev-explorer pane and right-click the project created before, e.g. "UrbanSim"
2.choose <import>
3.go to folder SVN and choose <project from svn> <NEXT>
4.check use existing repository location <NEXT>
5.In window 'checkout from SVN' Browse for 'trunk' in folder src <ok>
6.<finish>
7.in window 'checkout as' check <checkout as folder into existing project> and select the project you created, e.g. "UrbanSim" <finish> wait...be patient...not quite...done
8.Repeat this procedure to get following folders of the urbansim-SVN-repository:
-project_configs
-data
-local_databases
-settings
Differences:
- do not create a new project, it will be created automatically
- choose only the appropriate subfolder (without 'trunk') in step 5
- select "<Check out as project configured using the New Project Wizard>" in step 7
Configure Eclipse to use spaces rather than tabs in Python code and to 4 spaces for indentation
1. Open Window > Preferences... > Pydev (on Mac: File > Preferences... > Pydev)
2. go to the Tab Pydev>Editor
3. Set Tab length to '4'
3. Check "Replace tabs with spaces when typing?"
4. Uncheck 'Assume tab spacing when files contain tabs?'
(so that you detect tabs in files that should not have them )
Configure Eclipse to make it easy to run a Python program
1. Open Eclipse
2. Select Run > External Tools > External Tools configurations
3. Click on <Program> in the Configurations pane
4. Click the <New> button to create a new configuration
5. Fill in the following values:
* Name: Python2.6
* Location: browse to your Python location via the <Browse File System…> button.
(Should be in home/<username>/opus_env/bin/python2.6)
* set working directory to src-file in your workspace
result should look like: ${workspace_loc:/UrbanSim/src}
* setup Arguments to: ${resource_loc}
6. Click Apply and close the External Tools dialog box
Configure Run Configuration for OPUS GUI
1. Task <run> <Run configurations...>
2. go to <Python Run> and rightclick
3. choose <New> and stay in Tab 'main'
4. Type in name, e.g.
UrbanSim? ??_Gui
5. Browse for Project that was created before, e.g.
UrbanSim? ??6. browse for Main.Module
??, should be
UrbanSim? ??/src/opus_gui/opus.py
7. go to tab 'environment'
8. set new variables and values by going on <NEW>
OPUS_HOME /home/<username>/<eclipse workspace>/<your project folder>/
(e.g., OPUS_HOME /home/<username>/00_UrbanSim_workspace/UrbanSim/)
optional:
OPUS_DATA_PATH /home/<username>/<eclipse workspace>/<your project folder>/data
(e.g., OPUS_DATA_PATH /home/<username>/<eclipse workspace>/00_UrbanSim_workspace/UrbanSim/data)
9. <Apply>, <Run> -> OPUS GUI should start.
Next start of OPUS GUI
1. Go on the arrow of the <Run as> button, choose the above created run configuration
--
ChristofZoellig - 30 Jun 2010