No module named ... When I call a script via execfile(pyscript)
<p>I have a question about executing a script via execfile() in Python</p>

<p>My main script is located at <code>home/pi/var/www/html/main.py</code>. My second script is <code>home/pi/start.py</code> and includes several modules.</p>

<p>When I <code>execfile("/home/pi/start.py")</code> I get this error:</p>

<pre><code>&lt;type 'exceptions.ImportError'&gt; Python 2.7.9: /usr/bin/python
Tue May 10 18:27:41 2016
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /var/www/html/main.py in ()
    207 
    208     sys.stdout.flush()
    209 
    210 if __name__=="__main__":
=&gt;  211     main()
main = &lt;function main&gt;
 /var/www/html/web.py in main()
    165 
    166     if start is not None:
=&gt;  167         execfile("/home/pi/test.py")
    168        
    169     # 1 staat voor laatste uur
builtin execfile = &lt;built-in function execfile&gt;
 /home/pi/start.py in ()
      2 import time
      3 import RPi.GPIO as GPIO
      4 import os
      5 import sqlite3
      6 import Adafruit_DHT
pid undefined
&lt;type 'exceptions.ImportError'&gt;: No module named pid 
      args = ('No module named pid',) 
      message = 'No module named pid'
</code></pre>

<p>If someone know the answer feel free to share.</p>