Shell command run python, code 127, tried every combination

Hi,

Windows 10 PC with docker.
I have read as many with similar problem & just cannot get mine to run. Spend 2 full days now & think will have to give up

Visual Studio, run python file in terminal, works fine.
/bin/python /volume1/docker/homeassistant/config/python_scripts/hello_world.py

shell_command:
pymeteo: ‘/bin/python /volume1/docker/homeassistant/config/python_scripts/hello_world.py’

/bin/python /volume1/docker/homeassistant/config/python_scripts/hello_world.py, return code: 127

tried every combination of folder I can think off.

for ref. do need the full /volume1/docker/homeassistant/config/python_scripts/hello_world.py
for it to run in the terminal

simple python file that appends to a text file.

Anything I can try?
many thanks I/A

I use HAOS but here is how I call python scripts :

  - binary_sensor:
      name: ps5
      command: python3 /config/sensors/ps5.py -q -b 192.168.1.225
      scan_interval: 10

For the 165546321 time, a shell_command runs inside the HA container :wink:

Not sure what’s your environment to have /bin/python /volume1/docker/homeassistant/config/python_scripts/hello_world.py running on your Windows PC, but it’s different than the HA one.

Hi,

Thanks, obviously being really stupid but not sure how to run the shell_command runs inside the HA container?

this is in the configuration.yaml, in the docker container of HA, does this not mean it is inside the HA container already?
shell_command:
pymeteo: ‘/bin/python /volume1/docker/homeassistant/config/python_scripts/hello_world.py’
I started off with just “config/python_scripts/hello_world.py”
then “python config/python_scripts/hello_world.py”
“python3 config/python_scripts/hello_world.py” & a thousand other combinations which with restart in between took a very long time.
the only reason I showed
/bin/python /volume1/docker/homeassistant/config/python_scripts/hello_world.py
was from inside Visual Studio & click on the hello_world.py & run in terminal, this is what it showed.

As far as I remember installing docker & the HA container onto a windows PC was as per following instructions online so not sure why/if in a strange location.

Anyway this is driving me crazy & having to give up.

thanks anyway, I am normally pretty good with this stuff & can program python visual basic etc to a fairly good level over the year but this alludes me.

Oh, it does.
Just that:

  1. python is not in “/bin” inside the container
❯ docker exec -it ha-test bash
theia:/config# which python
/usr/local/bin/python
  1. You don’t have /volume1/docker/homeassistant/config/python_scripts inside the HA container, you have /config