Building a Python project using Pants on Bitbucket Pipelines Edited

I'm currently attempting to build a Python project using Pants. However, when I try to create my PEX files, I get the following error:

 **** Failed to install apache-beam-2.2.0 (caused by: NonZeroExit("received exit code 1 during execution of `[u'/usr/bin/python2.7', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpnnAmyB']` while trying to execute `[u'/usr/bin/python2.7', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpnnAmyB']`",)):


Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "", line 61, in <module>
_PIP_VERSION = get_distribution('pip').version
File "build/bdist.linux-x86_64/egg/pkg_resources/", line 553, in get_distribution
File "build/bdist.linux-x86_64/egg/pkg_resources/", line 427, in get_provider
File "build/bdist.linux-x86_64/egg/pkg_resources/", line 963, in require
File "build/bdist.linux-x86_64/egg/pkg_resources/", line 849, in resolve
pkg_resources.DistributionNotFound: The 'pip' distribution was not found and is required by the application

Invalidated 4 targets.
21:51:56 00:09 [complete]
Exception caught: (<class 'pex.resolver.Untranslateable'>)

Exception message: Package SourcePackage(u'file:///opt/atlassian/pipelines/agent/build/.pants.d/python-setup/resolved_requirements/CPython-2.7.9/') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)


I have tried to replicate the issue by following the "Debug your pipelines locally with Docker" article, but everything works fine; it's only when I'm trying to use Bitbucket Pipelines that I get this error message.

Here are the contents of my `bitbucket-pipelines.yml`, as well:

image: python:2.7

    - step:
      name: Create PEX files for all tasks
        - pip install pantsbuild.pants==1.3.0
        - for dir in src/python/*/; do pants binary ${dir}tasks::; done
        - dist/*

Any insight into how I can debug?

1 answer

0 votes


it looks like pip is not installed. 

Could you run `sudo easy_install pip` or if you are using python 2.6 `sudo easy_install_2.6 pip` ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

278 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you