Created
October 5, 2011 01:32
-
-
Save jyr/1263390 to your computer and use it in GitHub Desktop.
Python path with eggs
This file contains 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 | |
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