title: Installing python packages locally doesn't always work
body: <p>I'm creating a python 3.9 program and want to install packages locally. So the way my project is set up is this:</p>
  <pre><code>__main__.py
  test.py
  requirements.txt
  lib/
      __init__.py
  </code></pre>
  <p>In my requirements.txt file I have 3 lines:</p>
  <pre><code>colorama==0.2.2
  click==8.0.3
  pendulum==2.1.2
  </code></pre>
  <p>Then I run: <code>python -m pip install -r requirements.txt -t ./lib</code>
  This installs all the packages and dependencies inside of the lib directory.</p>
  <p>Then I import the modules at the top of my test.py file:</p>
  <pre><code>from lib import colorama
  from lib import click
  from lib import pendulum
  </code></pre>
  <p>In doing some testing, I've found that colorama works fine. I'll use it in a simple test:
  <code>print(colorama.Fore.BLUE + &quot;Hello, World!&quot;)</code>. The text is blue in the console and everything is working.</p>
  <p>I then try to use the other packages and I get ModuleNotFoundError exception:
  <code>print(pendulum.now('Europe/Paris'))</code></p>
  <p><code>Exception has occurred: ModuleNotFoundError - No module named 'pendulum'</code>
  This is coming from one of its own files.</p>
  <p>The same thing happens when I use Click, but it's a little different. I'll get the same ModuleNotFound exception, but it's for its own dependency on Colorama. I don't think it's related to the fact that I'm also importing Colorama because if I uninstall I get the same error.</p>
  <p>I've also tried this with the python-docx package. I added python-docx==0.8.11 to the requirements.txt file, then issued the same command as above to install to my local lib directory. It seems to install fine. I see the docx directory and all its dependencies. Then I import <code>from lib import docx</code> then do something simple in test.py:
  <code>doc = docx.Document()</code></p>
  <p>Then get ModuleNotFound error:   File &quot;C:\Users\name\Development\python\test-local-package\lib\docx_<em>init</em>_.py&quot;, line 3, in  (Current frame) No Module named 'docx'</p>
  <p>Does anyone know what I'm doing wrong?</p>