title: How to setup PYTHONPATH env in VScode properly
body: <p>The project structure is like</p>
  <pre><code>- a.py
  - unittest
     - test_a.py
  </code></pre>
  <p><strong>A.py</strong></p>
  <pre><code>class A():
      def function_a(self):
          return 'function_a'
  </code></pre>
  <p><strong>test_a.py</strong></p>
  <pre><code>from a import A
  
  class TestA():
      def test_a(self):
          assert A().function_a() == 'function_a'
  </code></pre>
  <p>When I use terminal and <code>set PATHONPATH=//&lt;my-project-folder&gt;</code>, it can be detected and tested via <code>pytest</code>. However, when I tried to debug it in VScode, it kept throwing out <code>No module named a</code>.</p>
  <p><a href="https://code.visualstudio.com/docs/python/environments#_environment-variable-definitions-file" rel="nofollow noreferrer">https://code.visualstudio.com/docs/python/environments#_environment-variable-definitions-file</a></p>
  <p>I've tried this way and put a <code>.env</code> inside my project folder.</p>
  <p><strong>.env</strong></p>
  <pre><code>PYTHONPATH=C:\\Repos\\test-project
  </code></pre>
  <p>(I did it with and without escaping, it didn't work anyway.)</p>
  <p><strong>.vscode/setting.json</strong></p>
  <pre><code>{
      &quot;python.pythonPath&quot;: &quot;C:\\Python27\\python.exe&quot;,
      &quot;python.testing.pytestArgs&quot;: [
          &quot;unittest&quot;
      ],
      &quot;python.testing.unittestEnabled&quot;: false,
      &quot;python.testing.nosetestsEnabled&quot;: false,
      &quot;python.testing.pytestEnabled&quot;: true,
      &quot;python.envFile&quot;: &quot;${workspaceFolder}/.env&quot;,
  }
  </code></pre>