Only python3 is installed
CommonThe script, a tool's hook or an old build script assumes a python command.
Confirm
head -1 SCRIPT command -v python python3
#!/usr/bin/env python, and only python3 found
Fix
- Change the shebang to #!/usr/bin/env python3, or run it as python3 SCRIPT.
- Where you control the machine or image and many tools expect python: sudo apt install python-is-python3.
- In a virtual environment, activate it first; it provides python.
sed -i '1s|^#!/usr/bin/env python$|#!/usr/bin/env python3|' SCRIPT
Reproduced on Ubuntu 24.04: changes only a first line that is exactly #!/usr/bin/env python, and the script then ran.