Created
April 15, 2015 14:09
-
-
Save ahoy-jon/ec8ef5c4eac95313bd74 to your computer and use it in GitHub Desktop.
I wanted to use python as I use my Clojure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if not hasattr(sys, 'real_prefix'): | |
#we need a virtualenv activated env. | |
raise NameError('Not in virtualenv') | |
from subprocess import call, check_output | |
import os | |
def install(prog): | |
my_env = dict(os.environ, PATH=os.environ.get('VIRTUAL_ENV') + "/bin:" + os.environ.get('PATH')) | |
return check_output(["pip install " + prog], env=my_env, shell=True) | |
install("sqlalchemy") | |
import sqlalchemy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment