zc.buildout
raw JSON → 5.2.0 verified Fri May 01 auth: no python
A powerful build system for managing development buildouts, automating setup of projects with multiple components. Version 5.2.0, with a stable release every few years.
pip install zc.buildout Common errors
error ImportError: No module named buildout ↓
cause Incorrect import statement; using 'import buildout' instead of 'import zc.buildout'.
fix
Change to 'import zc.buildout'.
error AttributeError: module 'zc.buildout' has no attribute 'Buildout' ↓
cause Old version of zc.buildout (<5.0) had Buildout class in a different location, or incorrect import path.
fix
Use 'from zc.buildout import Buildout' and ensure you're using zc.buildout >=5.0. For older versions, see documentation.
error ConfigParser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%(' ↓
cause Buildout config files use '%(...)s' substitution, but the parser interprets '%' specially.
fix
Escape '%' as '%%' in values where '%' is literal, e.g., 'url = http://example.com%%path'.
Warnings
breaking In version 5.0.0, the 'download-cache' option was removed. Use 'download-directory' instead. ↓
fix Replace 'download-cache = ...' with 'download-directory = ...' in buildout.cfg.
breaking Python 3.9+ required as of 5.0.0. Python 2.7 and older 3.x are no longer supported. ↓
fix Ensure you have Python >= 3.9 installed.
gotcha The 'zc.buildout' package installs the 'buildout' console script, but importing 'buildout' in Python gives a different package. Always import 'zc.buildout'. ↓
fix Use 'import zc.buildout' and ensure the namespace package 'zc' is installed.
deprecated The 'develop' recipe (zc.recipe.devel) is deprecated in favor of 'pip install -e' within the buildout environment. ↓
fix Use the 'pip' recipe or manual 'pip install -e .' inside the buildout environment.
Imports
- buildout wrong
import buildoutcorrectimport zc.buildout - Buildout wrong
from buildout import Buildoutcorrectfrom zc.buildout import Buildout
Quickstart
import zc.buildout
import os
# Basic usage: run from a directory with a buildout.cfg
if os.path.exists('buildout.cfg'):
buildout = zc.buildout.Buildout(os.getcwd())
buildout.install(None)
else:
print('No buildout.cfg found; create one first.')
print('Buildout ran successfully.')