Skip to content

Instantly share code, notes, and snippets.

@jyr
Created October 5, 2011 01:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jyr/1263390 to your computer and use it in GitHub Desktop.
Save jyr/1263390 to your computer and use it in GitHub Desktop.
Python path with eggs
import sys
import os
site_packages = "/Your/path/to/site-packages/"
sys.path.insert(0, site_packages)
def python_path_eggs():
paths = []
for egg in os.listdir(site_packages):
name, ext = os.path.splitext(egg)
if ext == '.egg':
paths.append(os.path.join(site_packages, egg))
sys.path[0:0] = paths
python_path_eggs()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment