Skip to content

Development Environment Setup Guide

Colin Hunt edited this page Mar 8, 2015 · 14 revisions

Dependencies

On the local machine (if necessary):
Install Python 3.4.2
$ easy_install pip
$ pip install virtualenv

Pull the repo:

$ git pull https://github.com/MarkGalloway/RIS/ ~/myLocation
$ cd ~/myLocation

Create the isolated python environment:

$ mkdir ~/env
$ mkdir ~/env/RIS
$ virtualenv -p /usr/local/bin/python3.4 ~/env/RIS
$ source ~/env/RIS/bin/activate
(RIS) $ pip install -r requirements.txt

Colin: When I did this I got

Collecting mysql-connector-python==2.0.3 (from -r requirements.txt (line 8))
  Could not find any downloads that satisfy the requirement mysql-connector-python==2.0.3 (from -r requirements.txt (line 8))
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external mysql-connector-python to allow).
  No distributions at all found for mysql-connector-python==2.0.3 (from -r requirements.txt (line 8))

I just had to run pip install mysql-connector-python --allow-external mysql-connector-python from the next section, and then this step again and it worked.

Verify that packages have been installed:

(RIS) $ yolk -l
You should see something along the lines of...
Flask - 0.10.1
Jinja2 - 2.7.3
etc..

Install MySql

I installed on OSX: homebrew install mysql
On Linux: $ sudo apt-get install mysql-server mysql-client (i think)
(Linux: If issues installing SQL-Alchemy... might need $ apt-get installlibmysqlclient15-dev
This is where things could get dicey... make sure you get 5.6.23

Try this: pip install mysql-connector-python --allow-external mysql-connector-python
It may not be necessary, may already be installed

Test launching the local dev server:

(RIS) $ python hello.py
You should see a message saying that the server is running.
Navigate to http://127.0.0.1:5000/ and see if it displays.

Cleanup

Done working for the day? Either close the terminal or deactivate virtualenv
(RIS) $ deactivate

Clone this wiki locally