Installation Guide for PyRe

14
Installation Guide for PyRe By: Teng Aladdin Young This installation guide is prepared for SMU-TCS iCity Lab using Amazon Web Services EC2 with Windows Server 2012 image. It shows a step-by-step guide for installing necessary software and packages for running PyRe from a newly launched server image. 2014 Aladdin Teng SMU-TCS iCity Lab 3/14/2014

Transcript of Installation Guide for PyRe

Page 1: Installation Guide for PyRe

Installation Guide for PyRe By: Teng Aladdin Young This installation guide is prepared for SMU-TCS iCity Lab using Amazon Web Services EC2 with Windows Server 2012 image. It shows a step-by-step guide for installing necessary software and packages for running PyRe from a newly launched server image.

2014

Aladdin Teng SMU-TCS iCity Lab

3/14/2014

Page 2: Installation Guide for PyRe

Table of Contents Prerequisites ........................................................................................................................................... 2

Notes before proceeding ........................................................................................................................ 2

Preparing Python .................................................................................................................................... 3

Python Installation .............................................................................................................................. 3

Setting the Python Environment Variables ......................................................................................... 4

Installing the Python Libraries ................................................................................................................ 5

NumPy ................................................................................................................................................. 5

ClusterPy ............................................................................................................................................. 6

GDAL ....................................................................................................................................................... 7

Installation .......................................................................................................................................... 7

Set Environment Variables .................................................................................................................. 8

Testing the Installation ....................................................................................................................... 8

Java and Tomcat ..................................................................................................................................... 9

Java Software Development Kit (JDK)/Java Runtime Environment (JRE) ........................................... 9

Set the Environment Variable ........................................................................................................... 10

Tomcat 7 ........................................................................................................................................... 11

Page 3: Installation Guide for PyRe

Prerequisites 1. Acquire a Windows machine, preferably with a server edition OS. This guide was prepared

with Amazon Web Services EC2 with Windows Server 2012.

2. Obtain the Installers folder with the following contents:

(https://www.dropbox.com/sh/gkhr9nhft7wbsch/TF452D9iP5)

Notes before proceeding The application was tested using the versions of the respective programs and libraries

included in the Installers folder. There is no guarantee they will be forward/backward

compatible with different versions of the same.

It is absolutely necessary to have 32-bit Python 2.7 and its corresponding libraries as

ClusterPy, the main clustering library is only guaranteed to run on 32-bit Python 2.7.

Tomcat 7 requires Java 7; conversely, Tomcat 6 requires Java 6. If you already have java

installed, just obtain the corresponding Tomcat zip file, and do not forget to set your

JAVA_HOME system environment variable.

Postgresql and Postgis are included in the Installers, but not necessary to run the application,

hence installation instructions for these will not be included in this manual.

Page 4: Installation Guide for PyRe

Preparing Python

Python Installation 1. Run “python-2.7.6.msi” from the Installers folder. In the event of missing Installers folder,

please download from: http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi

2. Proceed with the default location and settings.

Page 5: Installation Guide for PyRe

Setting the Python Environment Variables 1. Press the Windows key and search for System Environment Variables, and select Edit the

system environment variables. For previous versions of Windows OS, go to Control Panel,

select System, and go to Advanced System Settings on the left pane.

2. Edit the Path System Environment Variable to include the following:

C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Scripts;

3. Open Command Prompt, either by pressing Windows+R and typing cmd or using Shift+Right

Click and selecting Open Command Window here from any directory. Enter python, and you

should see the python live interpreter. Make sure that you have the 32-bit version, which

can be seen in the prompt. Keep the prompt open.

Page 6: Installation Guide for PyRe

Installing the Python Libraries

NumPy 1. Run “numpy-1.7.2-win32-superpack-python2.7” to install NumPy.

(http://sourceforge.net/projects/numpy/files/NumPy/1.7.2/numpy-1.7.2-win32-superpack-python2.7.exe/download)

2. Press Next. If you have multiple versions of Python, please select Python Version 2.7 [found

in registry].

3. Press Next, and proceed with the Installation until it finishes.

Page 7: Installation Guide for PyRe

ClusterPy

The main library that contains the clustering algorithms

1. Using the command prompt, exit python with Ctrl+C and change directory (cd) into the

clusterpy-0.9.9 folder inside Installers.

2. Enter python setup.py install.

3. To test the installation, you can run python, import the libraries and call __version__ on

them. Alternatively, obtain the Test folder and run python performance_script.py.

You should obtain similar results in testOutputs folder. (http://clusterpy.googlecode.com/files/performance_script.py + http://clusterpy.googlecode.com/files/performance_shapefiles.zip )

Page 8: Installation Guide for PyRe

GDAL

Installation Run the “gdal-110-1600-core.msi” installer. Follow the wizard and select Typical. (http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-gdal-1-10-0-mapserver-6-2-1.zip)

Page 9: Installation Guide for PyRe

Set Environment Variables 1. Go to System Environment Variables and add C:\Program Files (x86)\GDAL; to the Path.

2. Next, Press New... and create the GDAL_DATA variable pointing to

C:\Program Files (x86)\GDAL\gdal-data

Testing the Installation Open Command Prompt and type ogr2ogr. You should see the usage guide as shown below.

Page 10: Installation Guide for PyRe

Java and Tomcat

Java Software Development Kit (JDK)/Java Runtime Environment (JRE) 1. Inside the java folder, run the JDK installer appropriate for your machine’s architecture.

* JDK is preferred over JRE if you wish to make any future changes to the application

** JRE is packaged inside JDK JRE (32-bit): http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383

JRE (64-bit): http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385

JDK (32-bit): http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-windows-i586.exe

JDK (64-bit): http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-windows-i586.exe

2. If you chose to install JDK, it will install JRE for you as well.

Page 11: Installation Guide for PyRe

Set the Environment Variable 1. Add C:\Program Files\Java\jdk1.7.0_51\bin; to your Path System Environment Variable.

2. Create a new variable called JAVA_HOME with value: C:\Program Files\Java\jre7

Page 12: Installation Guide for PyRe

Tomcat 7 1. Unzip apache-tomcat-7.0.47.zip into C:\apache-tomcat\

2. Go to the unzipped directory and into the conf folder.

Edit tomcat-users.xml, and add a user with the roles “manager-script, admin, manager-gui”.

Username and password can be any arbitrary string value.

Page 13: Installation Guide for PyRe

3. Go up to the tomcat folder and into the bin folder.

Open a Command Prompt by Shift + Right Clicking any open space in the folder and select

“Open a command window here”. Run startup.bat.

4. Open a browser and go to http://localhost:8080. Click on Manager App on the right.

A prompt for username and password will appear. Enter the credentials created in Step 2.

5. Scroll down to “WAR file to deploy” and click Browse…. Find pyre.war in your directory and

click Open. Afterwards, click on Deploy.

Page 14: Installation Guide for PyRe

6. Once successful, the Applications list should contain a link to the application. Click on it.

7. Congratulations! You have successfully deployed PyRe on your machine.

Please refer to the User Manual for more details on how to use the application.