indigo-dc / udocker

A basic user tool to execute simple docker containers in batch or interactive systems without root privileges.
https://indigo-dc.github.io/udocker/
Apache License 2.0
1.38k stars 135 forks source link

Python binary not found on Ubuntu #394

Closed Tuupertunut closed 1 year ago

Tuupertunut commented 1 year ago

Udocker version: 1.3.8

How to reproduce:

Why this happens

The file https://github.com/indigo-dc/udocker/blob/master/udocker/maincmd.py starts with #!/usr/bin/env python. There is usually no binary called python on modern Ubuntu. Changing that line to #!/usr/bin/env python3 works.

mariojmdavid commented 1 year ago

hi the point is that other distros such as almalinux 9, python is already link to python3 by default furthermore we are still supporting udocker in older distros, where we have python(2)

until we drop support for python2, (this will happen in the next major version), we will have to keep the #!/usr/bin/env python

for ubuntu22.04 the solution is either to

apt install python-is-python3

or modify maincmd.py to have

!/usr/bin/env python3