title: ModuleNotFoundError: No module named 'pytest'
body: <p>After installing the <code>pytest</code> module in a virtual environment, I used the python code to call and run the prompt to find the <code>pytest</code> module.</p>
  
  <p>I installed the pytest module outside the virtual environment. I can call it normally with python.</p>
  
  <pre><code>import pytest
  
  
  def test_main():
      assert 5!=5
  
  if __name__ == "__main__":
      pytest.main()
  </code></pre>
  
  <p>The error is as follows：</p>
  
  <blockquote>
    <p>[Running] python -u "d:\MyPytest\test_sample.py"
        Traceback (most recent call last):
          File "d:\MyPytest\test_sample.py", line 1, in 
            import pytest
        ModuleNotFoundError: No module named 'pytest'
        [Done] exited with code=1 in 0.185 seconds</p>
  </blockquote>