How to make sure buildout doesnt use the already installed packages?

2024/10/9 4:19:58

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

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'>
>>> 

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

Answer

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

From buildout documentation:

You can then use include-site-packages= false and exec-sitecustomize = false buildout options to eliminate accessto your Python's site packages and notexecute its sitecustomize file, if itexists, respectively.

Alternately, you can use theallowed-eggs-from-site-packagesbuildout option as a glob-awarewhitelist of eggs that may come fromsite-packages. This value defaults to"*", accepting all eggs.

https://en.xdnf.cn/q/70057.html

Related Q&A

Can python setup.py install use wheels?

I am using setuptools. Is there a way to have the following command use wheels instead of source?python setup.py installIn particular, I have a custom package that requires pandas. While pandas insta…

Getting the last element of a level in a multiindex

I have a dataframe in this format:a b x 1 1 31 1 2 1 1 3 42 1 4 423 1 5 42 1 6 3 1 7 44 1 8 65437 1 9 73 2 1 5656 2 2 7 2 3 5 2 4 5 2 5 34a a…

Sphinx and JavaScript Documentation Workflow [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 5…

Getting two characters from string in python [duplicate]

This question already has answers here:Split string every nth character(19 answers)How to iterate over a list in chunks(40 answers)Closed last year.how to get in python from string not one character, b…

I Call API from PYTHON I get the response 406 Not Acceptable

I created a API in my site and Im trying to call an API from python but I always get 406 as a response, however, if I put the url in the browser with the parameters, I can see the correct answerI alrea…

TypeError: unsupported operand type(s) for +=: builtin_function_or_method and int

I am receiving this error (TypeError: unsupported operand type(s) for +=: builtin_function_or_method and int) when trying to run this codetotal_exams = 0 for total_exams in range(1, 100001):sum += tota…

Project Scipy Voronoi diagram from 3d to 2d

I am trying to find a way to calculate a 2d Power Diagram in Python. For this I want to make use of the fact that a 2d power diagram can be interpreted as the intersection of a regular 3d voronoi diagr…

Where can I see the list of built-in wavelet functions that I can pass to scipy.signal.cwt?

scipy.signal.cwts documentation says:scipy.signal.cwt(data, wavelet, widths)wavelet : functionWavelet function, which should take 2 arguments. The first argument is the number of points that the return…

How to play sound in Python WITHOUT interrupting music/other sounds from playing

Im working on a timer in python which sounds a chime when the waiting time is over. I use the following code:from wave import open as wave_open from ossaudiodev import open as oss_opendef _play_chime()…

How can I use click to parse a string for arguments?

Say I have a list of strings containing arguments and options, with argparse, I’m able to parse this list using the parse_args function into an object, as follows:import argparseextra_params = [‘—su…