Skip to content

Instantly share code, notes, and snippets.

@sebastialonso
Last active August 18, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastialonso/28e60f30ac18499195ea00b1bc80a90f to your computer and use it in GitHub Desktop.
Save sebastialonso/28e60f30ac18499195ea00b1bc80a90f to your computer and use it in GitHub Desktop.
Create a virtualenv with Tornado
# Install virtualenv
sudo pip install virtualenv
# Create the virtual envorinment
virtualenv --no-site-package app (# to use python3.5: `-p python3.5`)
# Install tornado in the virtual environment
app/bin/pip tornado
# After that, the following command should show something like tornado-VERSION-.egg
ls app/lib/python2.7/site-packages/
# Activeate virtual environment
source app/bin/activate
# your bash should look modified from this
#seba@dradisWork [14:52:53]
# to this
#(app) seba@dradisWork [14:52:53]
# Run the script using in-virtualenv python
bin/python2.7 webserver.py
=> web-server running
# Deactivate virtual environment
deactivate
# now the modified bash changes to its old self
Ref: http://www.programering.com/a/MDN1gDMwATg.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment