I am having some issues accessing python to run scripts on my instance of HomeAssistant OS Hyper-V image.
I am trying to run a script from an automation found here (Xfiniy-usage) and the zip with the xfinity-usage file
#!<path to hass>/bin/python3.7 # -*- coding: utf-8 -*- import re import sys from xfinity_usage.xfinity_usage import main if __name__ == '__main__': sys.argv = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv) sys.exit(main())
But when I go to run this I get the following error:
./xfinity-usage: <path: bad interpreter: No such file or directory
I see that it was becasue I wasn’t pointing to a dir, so I tried looking for python on ssh and could not find it
$ python ––version -bash: python: command not found
I commented out the first line of the xfinity-usage that was the version of python to use?, and then I get these errors:
./xfinity-usage ./xfinity-usage: line 3: import: command not found ./xfinity-usage: line 4: import: command not found ./xfinity-usage: line 5: from: command not found ./xfinity-usage: line 7: syntax error near unexpected token `(' ./xfinity-usage: line 7: ` sys.argv = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv)'
I looked at the web ui, and under system info I can see that home assistant is running python 3.8.5
But I cant seem to figure out how to use it for my scripts.
Any advice would be great, as this is proving to be more challenging than I had hoped.