title: Visual Studio Code launch.json settings for debugging Python modules
body: <p>Currently I have my file structure like this:</p>
  <pre><code>├── Utilities
  |   ├── __init__.py
  │   ├── module1.py
  ├── main.py
  ├── global_var.py
  </code></pre>
  <p>In <code>main.py</code> and <code>module1.py</code> I have already written <code>import global_var</code>, and everything goes well when I run <code>main.py</code>.</p>
  <p>However, when I tried to debug or run <code>module1.py</code> itself, it always shows</p>
  <blockquote>
  <p>Exception has occurred: ModuleNotFoundError <br/>
  No module named 'global_var'</p>
  </blockquote>
  <p>And I have to manually move <code>module1.py</code> to the same folder with <code>global_var.py</code> so that it can run successfully.</p>
  <p>I would like to know how to set the <code>launch.json</code> to stop moving the files. Here's my <code>launch.json</code> right now:</p>
  <pre><code>{
      &quot;name&quot;: &quot;Python: Modules&quot;,
      &quot;type&quot;: &quot;python&quot;,
      &quot;request&quot;: &quot;launch&quot;,
      &quot;program&quot;: &quot;${file}&quot;,
      &quot;cwd&quot;: &quot;${workspaceFolder}&quot;,
      &quot;console&quot;: &quot;integratedTerminal&quot;
  }
  </code></pre>