title: ModuleNotFoundError: No module named '...'
body: <p>I'm trying to install a few packages (<code>beautifulsoup4</code> and <code>requests</code>) for a project.</p>
  <p>I installed these packages by running these commands in the terminal on macOS:</p>
  <pre><code>pip3 install beautifulsoup4
  pip3 install requests
  </code></pre>
  <p>both did install successfully.</p>
  <p>Now if I open my project in PyCharm, I can import the modules by using:</p>
  <pre><code>from bs4 import BeautifulSoup
  import requests
  </code></pre>
  <p>Both packages are imported successfully and can be used in my code.
  To be sure everything was installed correctly, I looked at the <code>venv/lib/Python3.10</code> folder. <code>beautifulsoup4-4.10.0.dist-info</code>, <code>bs4</code>, <code>requests</code> and <code>requests-2.27.1.dist-info</code> are present.</p>
  <p>However, when I run the CGI script (Python), I get the following error in the terminal:</p>
  <pre><code>    from bs4 import BeautifulSoup
  ModuleNotFoundError: No module named 'bs4'
  </code></pre>
  <p>Even when I open a new terminal window and run the following commands:</p>
  <pre><code>python3
  &gt;&gt;&gt; from bs4 import BeautifulSoup
  </code></pre>
  <p>it runs fine without any errors.
  The same issue happens for the <code>requests</code> package.</p>
  <p>I also ran <code>pip3 install bs4</code> but that also didn't fix anything.</p>