Skip to content

Fix 'python3': No such file or directory failure#134

Merged
cgwalters merged 1 commit intobootc-dev:mainfrom
henrywang:fix-python
Mar 9, 2026
Merged

Fix 'python3': No such file or directory failure#134
cgwalters merged 1 commit intobootc-dev:mainfrom
henrywang:fix-python

Conversation

@henrywang
Copy link
Contributor

@henrywang henrywang commented Mar 9, 2026

Fix 'python3': No such file or directory failure

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical build failure in the Debian development container by ensuring that the python3 executable is present during the tools build stage. The change temporarily installs Python, allowing necessary scripts to run, and then uninstalls it to prevent unnecessary bloat in the final image. This improves the reliability and consistency of the build environment.

Highlights

  • Build Fix: Resolved a 'python3: No such file or directory' error during the build process within the Debian container environment.
  • Temporary Python Installation: Implemented a temporary installation of python3 specifically for the tools build stage, ensuring it's available when fetch-tools.py is executed, and then promptly removed to maintain a lean image.
  • Dockerfile Syntax Consistency: Standardized the FROM ... as ... syntax to FROM ... AS ... across multiple build stages in the Containerfile.debian.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • devenv/Containerfile.debian
    • Updated Dockerfile syntax for build stages from as to AS for consistency.
    • Introduced a temporary installation and subsequent removal of python3 in the tools build stage to resolve a 'python3: No such file or directory' error.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a 'python3: No such file or directory' error by installing Python before running a Python script in the Dockerfile. The change correctly installs and then removes Python within a single RUN layer to avoid bloating the image. I've suggested a small improvement to further optimize the Docker layer by cleaning up apt caches and avoiding recommended packages, which is a common best practice.

ARG uvversion=0.10.2
COPY fetch-tools.py tool-versions.txt install-uv.sh /run/src/
RUN /run/src/fetch-tools.py
RUN apt -y install python3 && /run/src/fetch-tools.py && apt -y purge python3 && apt -y autoremove

Choose a reason for hiding this comment

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

medium

To improve Docker layer hygiene and minimize layer size, it's best practice to use --no-install-recommends with apt install and to clean up apt metadata within the same RUN instruction. This prevents unnecessary packages from being installed and removes cached files that are not needed in the image layer.

RUN apt -y install --no-install-recommends python3 && /run/src/fetch-tools.py && apt -y purge python3 && apt -y autoremove && apt clean && rm -rf /var/lib/apt/lists/*

@cgwalters cgwalters merged commit b4a1ea1 into bootc-dev:main Mar 9, 2026
10 checks passed
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