如何确保buildout不使用已经安装的软件包? [英] How to make sure buildout doesn't use the already installed packages?

查看:226
本文介绍了如何确保buildout不使用已经安装的软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试完全切换到buildout,但是我们的开发环境已经在 / usr / lib / pythonxx /

I am trying to switch fully to buildout - but our development environment already has lot of stuff installed in /usr/lib/pythonxx/

如何确保buildout不使用系统上已安装的库 - 最终没有virtualenv?

How can I make sure that buildout doesn't use the libraries installed on the system already - eventually without virtualenv ?

例如 - 如何避免这种行为? :

For example - how to avoid this behavior ? :

> 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中的鸡蛋?

Is there anyway to force buildout NOT to use the eggs installed in /usr/lib/python2.6 ?

推荐答案

如果要使用这两个指令之一使用site-pakage,可以告诉buildout: include-site-packages allowed-eggs-from-site-packages

You can tell buildout if you want to use site-pakages or not with one of these two directives: include-site-packages and allowed-eggs-from-site-packages

从buildout 文档

From buildout documentation:


然后可以使用include-site-packages
= false和exec-sitecustomize = false buildout选项来消除访问
到您的Python的网站包,而不是
执行其sitecustomize文件,如果
分别存在。

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.

另外,你可以使用
allowed-eggs-from-site-packages
buildout选项作为可能来自
site-packages的全球感知
白名单的鸡蛋。该值默认为
*,接受所有鸡蛋。

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.

这篇关于如何确保buildout不使用已经安装的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆