title: "ModuleNotFoundError: No module named xxxx" after installing module with pip
body: <p>I'm trying to import three modules that I've installed with pip: requests, bs4, and pillow. I'm installing them from the command line, but I'm attempting to import them from both the command line and Anaconda. The problem is that bs4 and pillow are unavailable from the command line, and pillow is unavailable from within Anaconda</p>
  <pre><code># installing bs4 (other installations have been omitted for brevity)
  PS C:\Users\xxxx\AppData\Local\Programs\Python\Python38\Lib&gt; pip install bs4
  Processing c:\users\xxxx\appdata\local\pip\cache\wheels\0a\9e\ba\20e5bbc1afef3a491f0b3bb74d508f99403aabe76eda2167ca\bs4-0.0.1-py3-none-any.whl
  Requirement already satisfied: beautifulsoup4 in c:\users\xxxx\anaconda3\lib\site-packages (from bs4) (4.9.1)
  Requirement already satisfied: soupsieve&gt;1.2 in c:\users\xxxx\anaconda3\lib\site-packages (from beautifulsoup4-&gt;bs4) (1.9.5)
  Installing collected packages: bs4
  Successfully installed bs4-0.0.1
  
  # verifying that requests, bs4, and pillow are in the list of installed modules
  PS C:\Users\xxxx\AppData\Local\Programs\Python\Python38\Lib&gt; pip list | Select-string &quot;requests|bs4|pillow&quot;
  
  bs4                                0.0.1
  Pillow                             7.2.0
  requests                           2.24.0
  
  
  PS C:\Users\xxxx\AppData\Local\Programs\Python\Python38\Lib&gt;
  
  # starting Python and trying to import the module
  PS C:\Users\xxxx\AppData\Local\Programs\Python\Python38\Lib&gt; py
  Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt; import requests
  &gt;&gt;&gt; import bs4
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  ModuleNotFoundError: No module named 'bs4'
  &gt;&gt;&gt; import pillow
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  ModuleNotFoundError: No module named 'pillow'
  </code></pre>
  <p>I noticed that my packages keep installing in C:\users\xxxx\anaconda3\lib\site-packages, but the problem seems to be that they need to install in the C:\Users\xxxx\AppData\Local\Programs\Python\Python38\Lib directory. I was able to copy the folder that contains the &quot;requests&quot; module over to C:\Users\xxxx\AppData\Local\Programs\Python\Python38\Lib, and now I can import it from the command line and from within Anaconda.</p>
  <p>However, after installing bs4 and pillow, bs4 can be imported from Anaconda but not imported on the command line and pillow cannot be imported from Anaconda or the command line.</p>
  <p>I have already tried pip3, but I get an error saying that that is not a recognized command.
  I have tried uninstalling bs4 and pillow, running <code>$PYTHONPATH = &quot;C:\Users\xxxx\AppData\Local\Programs\Python\Python38\Lib&quot;</code>, and reinstalling the modules. I got a message saying that the requirements for bs4 were already satisfied, and it said that it installed pillow. Still, neither are available from the command line</p>
  <p>UPDATE: I repaired Python, and now I can import bs4, but I still cannot import pillow from the command line or from within Anaconda. Also, when I type out &quot;python&quot; into the command line instead of just &quot;py&quot;, I get this warning message:</p>
  <pre><code>Warning:
  This Python interpreter is in a conda environment, but the environment has
  not been activated.  Libraries may fail to load.  To activate this environment
  please see https://conda.io/activation
  </code></pre>
  <p>When I try to activate my conda environment, per the website in the warning message, I don't get any errors in the activation process, but the warning message persists:</p>
  <pre><code>PS C:\Users\xxxx&gt; conda info --envs
  # conda environments:
  #
  base                  *  C:\Users\xxxx\Anaconda3
  
  PS C:\Users\xxxx&gt; conda activate base
  PS C:\Users\xxxx&gt; python
  Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
  
  Warning:
  This Python interpreter is in a conda environment, but the environment has
  not been activated.  Libraries may fail to load.  To activate this environment
  please see https://conda.io/activation
  
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt;
  </code></pre>