2

I am installing a python application on an ubuntu server. I have added include-site-packages=false in buildout.cfg but it is still not ignoring dist-packages.

Aman
  • 4,786
  • 1
  • 17
  • 17

1 Answers1

3

Buildout doesn't know about anything dist-packages, as that's a Debian and Ubuntu specific addition to Python. If buildout doesn't exclude it when you exclude site-packages, then is not the only package to have this 'problem'; virtualenv doesn't know about it either, see Ubuntu + virtualenv = a mess? virtualenv hates dist-packages, wants site-packages.

Feel free to file an issue in the buildout issue tracker to request that dist-packages is included when ignoring site-packages.

Note that on my Debian system however, the dist-packages directory is being excluded.

Buildout normally determines what the site-packages directories are by determining the difference between the following two commands:

PYTHONNOUSERSITE="x" python -c "import sys, os;print repr([os.path.normpath(p) for p in sys.path if p])"

and

python -S -c "import sys, os;print repr([os.path.normpath(p) for p in sys.path if p])"

If the latter still includes the dist-packages directory for you, then I'd classify this as a Ubuntu or Debian bug. On Debian 6.0.5, with zc.buildout 1.5.2 that path is not included.

The dist-packages directory is normally added via the site.py module (which the -S switch above disables). Debian and Ubuntu have patched that module.

Community
  • 1
  • 1
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • Hi Martijn, I was expecting this answer. Is there a way around? – Aman Jul 04 '12 at 13:59
  • I've included some detail as to how buildout determines what the `site-packages` paths are, perhaps you can figure this out on your own ssystem with this information. Otherwise you'd have to patch the `_get_system_paths` method in the `easy_install` module with the zc.buildout package. – Martijn Pieters Jul 04 '12 at 17:22