Skip to content

Instantly share code, notes, and snippets.

@idan
Created September 30, 2009 20:13
Show Gist options
  • Save idan/198396 to your computer and use it in GitHub Desktop.
Save idan/198396 to your computer and use it in GitHub Desktop.
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
del virtual_env
del site, environ, join, version_info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment