"bad interpreter: Input/output error"

Ian Bruntlett ian.bruntlett at gmail.com
Sat Jan 13 17:01:45 UTC 2024


Hi Jeff,

On Sat, 13 Jan 2024 at 16:25, Jeff <atrocity at wywh.com> wrote:

> On 1/13/24 07:24, Ian Bruntlett wrote:
>   > 3. Can you send the results of a hex dump of a faulty bash script to
>  > here?
>
> Sure, here you go. I submitted this command:
>
> head -1 /mnt/WD8TBNAS03/Documents/ShellScripts/test.py | od -A x -t x1z -v
>
> and got this back:
>
> 000000 23 21 2f 75 73 72 2f 62 69 6e 2f 70 79 74 68 6f >#!/usr/bin/pytho<
> 000010 6e 33 0a                                         >n3.<
> 000013
>

> If I just submit test.py I get:
>
> bash: /mnt/WD8TBNAS03/Documents/ShellScripts/test.py: /usr/bin/python3:
> bad interpreter: Input/output error
>

I've compared your shebang (#!) statement's hex dump to an identical
(working) one on my system. I found no differences.

0. I've done some searching about this. I think it is down to you storing
your scripts on a NAS drive. Can you copy a script from the NAS drive and
see if it will run OK from a local drive's directory? This webpage might be
of interest: https://github.com/microsoft/WSL/issues/2969 . I think the NAS
drive might be mounting as "noexec"

Failing that, here are some other ideas...

1. What is the output of:
which python3

2. When you run test.py, and get the Input/Output error, what is the output
of this command:
echo $?

3. Try this as a script and see if it works:
#!/usr/bin/env python3
print ("Hello")

4, Try this - it should get you into the python command line:
$ env --debug python3

HTH,


Ian

-- 
-- ACCU - Professionalism in programming - http://www.accu.org
-- My writing - https://sites.google.com/site/ianbruntlett/
-- Free Software page -
https://github.com/ian-bruntlett/TECH-Manuals/blob/main/tm-free-software.md
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20240113/43976e33/attachment.html>


More information about the ubuntu-users mailing list