title: Import "flask" could not be resolved from sourcePylancereportMissingModuleSource
body: <p>Appreciate that this has been asked before, but I have tried the suggestions to no avail.</p>
  <p><a href="https://i.stack.imgur.com/vzld2.png" rel="nofollow noreferrer">a snip of flask not loading, with pip show flask output</a></p>
  <p>VSCode is telling me that: <em>Import &quot;flask&quot; could not be resolved from sourcePylancereportMissingModuleSource)</em></p>
  <p>Running <code>export</code> shows me:</p>
  <pre class="lang-sh prettyprint-override"><code>FLASK_APP=app.py
  FLASK_ENV=development
  </code></pre>
  <p>I can run <code>flask run</code> and my app works, but when I run <code>pytest</code>, I receive:</p>
  <pre><code>______________________ ERROR collecting tests/unit/test_app.py ______________________
  ImportError while importing test module '/Users/myname/projects/flask-stock-portfolio/tests/unit/test_app.py'.
  Hint: make sure your test modules/packages have valid Python names.
  Traceback:
  /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py:127: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  tests/unit/test_app.py:4: in &lt;module&gt;
      from app import app
  E   ModuleNotFoundError: No module named 'app'
  </code></pre>
  <p>Where <strong>test_app.py</strong> reads:</p>
  <pre class="lang-py prettyprint-override"><code>&quot;&quot;&quot;
  This file (test_app.py) contains the unit tests for the app.py file.
  &quot;&quot;&quot;
  from app import app
  
  def test_index_page():
      &quot;&quot;&quot;
      GIVEN a Flask application
      WHEN the '/' page is requested (GET)
      THEN check the response is valid
      &quot;&quot;&quot;
      with app.test_client() as client:
          response = client.get('/')
          assert response.status_code == 200
          assert b'Flask Stock Portfolio App' in response.data
          assert b'Welcome to the Flask Stock Portfolio App!' in response.data
  </code></pre>
  <p>Anything you can do to point me in the right direction would be greatly appreciated.</p>