我正在尝试完全切换到构建 - 但我们的开发环境已经在 /usr/lib/pythonxx/
中安装了很多东西
我如何确保 buildout 不使用系统上已经安装的库 - 最终没有 virtualenv ?
例如 - 如何避免这种行为? :
> cat buildout.cfg
[buildout]
parts = django
[django]
recipe = zc.recipe.egg
eggs = django
interpreter = django
>bin/django
>>> import django
>>> django
<module 'django' from '/usr/lib/python2.6/site-packages/django/__init__.pyc'>
>>>
有没有强制构建不使用安装在/usr/lib/python2.6 中的鸡蛋?
最佳答案
您可以通过以下两个指令之一告诉 buildout 是否要使用站点包:include-site-packages
和 allowed-eggs-from-site-packages
来自扩建documentation :
You can then use include-site-packages = false and exec-sitecustomize = false buildout options to eliminate access to your Python's site packages and not execute its sitecustomize file, if it exists, respectively.
Alternately, you can use the allowed-eggs-from-site-packages buildout option as a glob-aware whitelist of eggs that may come from site-packages. This value defaults to "*", accepting all eggs.
关于python - 如何确保 buildout 不使用已经安装的包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4839194/