Skip to main content
Version: 2.9 (deprecated)

Installing Pants


Creating the launch script

Pants is invoked via a launch script named ./pants , saved at the root of the repository. This script will install Pants and handle upgrades.

First, set up a minimal pants.toml config file to instruct the script to download the latest 2.9 release:

printf '[GLOBAL]\npants_version = "2.9.1"\n' > pants.toml

Then, download the script:

curl -L -O https://static.pantsbuild.org/setup/pants && chmod +x ./pants

Now, run this to bootstrap Pants and to verify the version it installs:

./pants --version
Tip: add ./pants to version control

We strongly recommend checking the ./pants script into your repo. This will allow all users to use Pants without having to manually set up this script themselves.

Upgrading Pants

The ./pants script will automatically install and use the Pants version specified in pants.toml, so upgrading Pants is as simple as editing the version in that file.

Running Pants from unreleased builds

To use an unreleased build of Pants from the pantsbuild/pants main branch, locate the main branch SHA, set PANTS_SHA=<SHA> in the environment, and run ./pants as usual:

PANTS_SHA=22c566e78b4dd982958429813c82e9f558957817 ./pants --version

Building Pants from sources

We currently distribute Pants for Linux (x86_64) and macOS.

If you need to run Pants on some other platform, such as Linux on ARM or Alpine Linux, you can try building it yourself by checking out the Pants repo, and running ./pants package src/python/pants:pants-packaged to build a wheel.

Running Pants from sources

See here for instructions on how to run Pants directly from its sources. This is useful when making changes directly to Pants, to see how those changes impact your repo.