Piano-LED-Visualizer
Piano-LED-Visualizer copied to clipboard
Clean up all invocations of python3
For maximum portability, convert to using #!/usr/bin/env python3 and change the execution bit in the git tree. That should mean even if it is copied the execute bit is preserved.
Signed-off-by: Jason Wessel [email protected]
I'm getting
pi@raspberrypi:~ $ sudo /home/Piano-LED-Visualizer/visualizer.py
/usr/bin/env: ‘python3\r’: No such file or directory
also doesn't seem to start on reboot after editing crontab.
edit.
which
returns
pi@raspberrypi:~ $ sudo which python3
/usr/bin/python3
edit 2. It seems to be formatting problem? https://stackoverflow.com/questions/19425857/env-python-r-no-such-file-or-directory
hmm... That seems odd. How do you checkout the git repository? Generally speaking you would only get the \r error if the file is formatted as a checkout from a Windows machine or if you have a git repository with the wrong value of core.autocrlf.
If you run "dos2unix visualizer.py" does the problem go away?
In my checkout, it just works. You can can still leave the "sudo python3 visualizer.py" if that is safer. I had made the change so I could directly execute it.
Is it probably an OS thing? I am remembering you told somewhere you are not using the official Raspberry OS image.
When creating a simple hello world script with the #!/usr/bin/env python3?
line, it won't run for me as well. DOS vs. UNIX file formatting should not be an issue here.
How do you checkout the git repository?
git fetch origin pull/320/head:python3
If you run "dos2unix visualizer.py" does the problem go away?
Yes, it works.