title: Running Luigi task from cmd - "No module named tasks"
body: <p>I am having problems running a Luigi task through the Windows cmd. Here are the facts:  </p>
  
  <ul>
  <li><p>Running Anaconda installed in C:\ProgramData\Anaconda2 (Python 2.7)  </p></li>
  <li><p>Anaconda has added its paths to the PATH variable but there is no PYTHONPATH variable   </p></li>
  <li><p>The task i am trying to run is located in <code>C:\....\tasks.py</code></p></li>
  <li><p>Trying to run it as follows:</p>
  
  <blockquote>
    <p>C:\.... luigi --module tasks MyTask --dt 20170316<br>
    ImportError: No module named tasks  </p>
  </blockquote></li>
  </ul>
  
  <p>I tried creating a <code>PYTHONPATH</code> variable and adding the exact path to the directory containing my <code>tasks.py</code> file but it didn't work. Another problem I am having, which may be related is when I launch the luigi scheduler through cmd using:</p>
  
  <pre><code>luigid
  </code></pre>
  
  <p>it works fine but whenever I try to start it using:</p>
  
  <pre><code>luigid --background
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>No module named pwd
  </code></pre>
  
  <p>It seems like there is something wrong with my setup overall, any help would be appreciated.</p>