Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(setup): use pipx for Ansible to avoid conflicts between pip and apt packages #2897

Merged
merged 2 commits into from
Sep 27, 2022

Conversation

kenji-miyake
Copy link
Contributor

@kenji-miyake kenji-miyake commented Sep 27, 2022

Description

Installing ansible via pip can conflict with some apt packages.

$ docker run --rm -it ubuntu:20.04 /bin/bash
$ apt update && DEBIAN_FRONTEND=noninteractive apt -y install python3-flask && apt -y install python3-pip && pip install ansible
$ python3
>>> import flask
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.8/dist-packages/jinja2/__init__.py)

Also previously, there was a similar error.
#2849

To avoid these kinds of errors, I'd like to use pipx instead, which can create a virtual environment for application packages.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Kenji Miyake added 2 commits September 27, 2022 17:28
…and apt packages

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Copy link
Contributor

@wep21 wep21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kenji-miyake kenji-miyake merged commit 904aa4a into main Sep 27, 2022
@kenji-miyake kenji-miyake deleted the use-pipx-for-ansible branch September 27, 2022 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants