virtual_site = os.path.join(os.environ.get('VIRTUAL_ENV'), py_infix,
    'site-packages')
dist_site = os.path.join('/usr', py_infix, 'dist-packages')
sys.path = [p for p in sys.path if not p.startswith(dist_site)]
sys.path.insert(0, virtual_site)
Вызов IPython из virtualenv