Skip to content

/usr/bin/env: ‘python3’: No such file or directory when running in docker #1141

@ibolit

Description

@ibolit

I am trying to run my build on CI, where it is executed in a docker container with very little installed in it. To make matters simpler, I wrote a python file that prints out the current python version.

I followed the instructions on registering the toolchain from the README in this repository, and it works great on my local Mac. To make sure that I am using the python from the hermetic toolchain, I changed the python_version in my WORKSPACE.bazel file, and my simple programme did indeed start printing out that new version.

However, when I run it in the container that will be used on CI, I get the /usr/bin/env: ‘python3’: No such file or directory error.

At some point I installed Emacs in that container to be able to edit files, and the build magically started working. Turns out, Emacs installs a version of python. The weird bit is that the python version printed out by my programme is the one that is set in the WORKSPACE.bazel file and does change when I change the python_version in workspace.

Is this a bug in python_rules or do I have to add something to my WORKSPACE.bazel or install into my Docker container?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions