Created
October 10, 2011 16:55
-
-
Save jhalcrow/1275789 to your computer and use it in GitHub Desktop.
virtualenv & ipython
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
def virtualenv(): | |
import site | |
from os import environ | |
from os.path import join | |
from sys import version_info | |
if 'VIRTUAL_ENV' in environ: | |
virtual_env = join(environ.get('VIRTUAL_ENV'), | |
'lib', | |
'python%d.%d' % version_info[:2], | |
'site-packages') | |
site.addsitedir(virtual_env) | |
print 'VIRTUAL_ENV ->', virtual_env | |
virtualenv() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment