"bad interpreter: Input/output error"

Little Girl littlergirl at gmail.com
Sat Jan 13 16:14:20 UTC 2024


Hey there,

Jeff wrote:

>Just updated Ubuntu Desktop 22.04.3 LTS and everything went
>smoothly, but now any attempt to execute a shell or Python 3 script
>results in some version of the subject line.
>
>I can prepend "bash" or the path to Python and it works normally,
>but it looks like something has rendered the system unable to
>interpret the shebang line.
>
>Take this little two-liner for example:
>
>#!/usr/bin/python3
>print("Does this work?\n")
>
>The above works fine if I enter "/usr/bin/python3
>/path/to/script.py" but if--despite having previously worked for
>years--I just enter "/path/to/script.py" I get the bad interpreter
>error.

Interesting. I didn't realize we could run Python scripts in that way.
I run mine with the "python3 foo.py" command.

I messed around with this a bit and found that setting the script file
as executable in its permissions makes it so that just its path can
be used to run it:

https://askubuntu.com/questions/484718/how-to-make-a-file-executable

-- 
Little Girl

There is no spoon.



More information about the ubuntu-users mailing list