title: python library loads and works properly from command line, but 'ImportError: No module' if I try to run at boot
body: <p>I’m trying to run a couple of python programs at boot time (in connection with some halloween costumes I’ve been making with my kids; I don’t want somebody to have to log in remotely to start the software in their costumes if they have to reboot for some reason).</p>
  
  <p>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:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/pi/sound.py", line 4, in &lt;module&gt;
      from pad4pi import rpi_gpio
  ImportError: No module named pad4pi
  </code></pre>
  
  <p>Additional information:
  Some additional color: <code>which python</code> returns '/usr/bin/python’ and I have fully specified in rc.local that this is the python to use (<code>/usr/bin/python /home/pi/sound.py &amp;</code>)</p>
  
  <p>I installed with <code>pip install pad4pi</code>, and checking a moment ago it confirms that
  <code>pad4pi in ./.local/lib/python2.7/site-packages (1.1.5)</code></p>
  
  <p>Why would the pad4pi  library (which is needed in both projects I’m working on) be available from the command line but not at launch? And more importantly, what can I do about it?</p>
  
  <p>[Note, solution below. I will accept the answer when stackOverflow lets me.]</p>