0

I needed to create a custom image for AWX so that I can add external python modules to my ansible playbooks. I installed ansible-builder to do that but I'm getting the following error for any commands I try to run with ansible-builder :

me@ansible:~$ ansible-builder --help
Traceback (most recent call last):
  File "/usr/local/bin/ansible-builder", line 7, in <module>
    from ansible_builder.cli import run
  File "/usr/local/lib/python3.5/dist-packages/ansible_builder/cli.py", line 104
    help=f'The name(s) for the container image being built (default: {constants.default_tag})')
                                                                                             ^
SyntaxError: invalid syntax

I installed it on debian 9 like so :

pip install ansible-builder

I tried to install it with pip and pip3, my user and root but I'm getting the same error everytime.

Ror
  • 141
  • 2
  • 10
  • https://ansible-builder.readthedocs.io/en/stable/installation/ `ansible-builder` version 1.1.0 **requires Python 3.8 or higher**. https://pypi.org/project/ansible-builder/3.0.0/ **requires Python >= 3.9** – phd May 26 '23 at 08:01

1 Answers1

0

f-strings only became available in python 3.6 (PEP-498 and you are using python 3.5 (from your traceback: "/usr/local/lib/python3.5/dist-packages/ansible_builder/cli.py"), so you have a version incompatibility.

You will need to update to a more recent python version. Even the oldest ansible-builder release on Pypi requires Python >=3.6, <4.0

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53