Overview of the Installation ProcessΒΆ

The zc.buildout software is very easy to install with only one dependency, on the setuptools package that provides manipulation facilities for Python eggs.

  1. Many existing projects are already based on zc.buildout and include within their project files the necessary bootstrap.py file. To activate use of zc.buildout within such a project, simply run that bootstrap.py using the specific Python interpreter for the project. This may be the system Python or in the case of a virtualenv sandbox, the Python within the bin/ subdirectory of the project.

    $ cd projectdir
    $ bin/python bootstrap.py
    
  1. While zc.buildout is most often installed within each project directory, it can also be installed system-wide, to make it easy to create new projects.

    $ pip install zc.buildout
    

    This gives you a new command named buildout to use in initializing or updating a project.

  1. To add zc.buildout to a new project, the primary step is to execute the buildout init command while your current directory is set to the root of the project directory. This command will create all necessary files/directories, including a minimal buildout.cfg file to control buildout.

    $ cd newproject
    $ buildout init
    

    This command sequence will use the system Python for the project. If you have some other project set up that uses zc.buildout you can borrow its buildout command to initialize your new project.

    $ cd newproject
    $ /oldproject/bin/buildout init
    

    Unfortunately this sequence of commands will not provide a bootstrap.py command for others to use to initialize zc.buildout when they receive a copy of your project. Therefore it is recommended that you download and incorporate a copy of bootstrap.py within your project fileset.

    $ cd newproject
    $ wget -O bootstrap.py https://bootstrap.pypa.io/bootstrap-buildout.py
    

A good next step in understanding zc.buildout is Directory Structure of a Buildout which also covers which file/directories should be under version control and which should not.