Closed CentralHarlemAnonymous closed 4 years ago
I have several projects using pad4pi that load at boot time and run just fine, day in and day out. I suspect it has to do with where you installed the pad4pi library. I don't have access to any of those devices at the moment, so I can't check. It might also have something to do with how you are launching it at boot time.
Some additional color: which python
returns '/usr/bin/python’ and I have fully specified in rc.local that this is the python to use (/usr/bin/python /home/pi/sound.py &
)
I installed with pip install pad4pi
, and checking a moment ago it confirms that
pad4pi in ./.local/lib/python2.7/site-packages (1.1.5)
problem now solved: pad4pi was not appearing in $Pythonpath. I added
export PYTHONPATH=$PYTHONPATH:/home/pi/.local/lib/python2.7/site-packages
to my rc.local file, before it ran my python code, and all was well.
I’m not sure whether this is a problem with the library or the installation script or something else, but I have a couple of python programs using pad4pi that I want to run at boot time.
The software works perfectly if run from the command line, whether launched from its own directory or any other. However if I try to run at launch by putting the script in rc.local, nothing happens and I log the following error:
Why would the library be available from the command line but not at launch? Can this be fixed?