Comment 1 for bug 429383

Revision history for this message
Martijn Faassen (faassen) wrote :

One possible implementation strategy would be to add the following to the generated scripts,
after the sys.path assignment:

import site
packages = set(sys.path)
site_packages = set()
site.addsitepackages(site_packages)
packages = packages.difference(site_packages)
sys.path = list(packages)

What this does is add the site packages according to the 'site' module, and then remove them from the path again.

We could make it an option in buildout.cfg or an option to bin/buildout. The problem with doing this to bin/buildout means that people could accidentally add site-packages again when they re-run buildout. Since this is a problem that especially beginners run into, this seems rather risky. Or we could do both.