Reputation: 125
Good morning all. I am looking for some help figuring out what exactly is going on with an error I am receiving. I recently upgraded from a Pi B+ to a Pi 2 running on Debian Jessie. I am using my Pi as a web-based kiosk and web-based internet radio server. At startup, I am running the following script:
#!/bin/sh
# launcher.sh
# navigate to home directory, then to this directory, then execute python script, then back home
cd /
cd /home/pi/Desktop/Pianobar-Web
python pianobar_web.py
cd /
This script worked on Wheezy and is even working on Jessie to start my application. However, when trying to start part of the application I am now getting an error related to Python. I am not very experienced with Debian and seem to be missing a file or dependency needed to run my application. Please see the error message below for information:
> Error: 500 Internal Server Error
>
> Sorry, the requested URL 'http://192.168.0.125:8080/auth' caused an
> error: Internal Server Error
>
> Exception: OSError(2, 'No such file or directory')
>
> Traceback: Traceback (most recent call last): File
> "/home/pi/Pianobar-Web/bottle.py", line 845, in _handle
> return route.call(**args) File "/home/pi/Pianobar-Web/bottle.py", line 1709, in wrapper
> rv = callback(*a, **ka) File "pianobar_web.py", line 67, in authenticate
> proc = subprocess.Popen("pianobar", stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File
> "/usr/lib/python2.7/subprocess.py", line 710, in __init__
> errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
> raise child_exception OSError: [Errno 2] No such file or directory
I have tried making sure that python 2.7 is installed and up-to-date by using the command "apt-get install python2.7", but I already have the most recent version installed. Any help would be greatly appreciated.
Thank you!
Upvotes: 0
Views: 138
Reputation: 125
File "pianobar_web.py", line 67, in authenticate
proc = subprocess.Popen("pianobar", stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
I found the fix finally. I had to change the path to "pianobar" in line 67 of the "pianobar_web.py" script file to reflect the full path to the app.
Upvotes: 0
Reputation: 5323
Assuming that the file pianobar
is sitting next to the .py
file you execute, you could call Popen('./pianobar', ....
. Alternatively, add the directory to the PATH variable in your shell script before calling Python.
Upvotes: 0