title: Python Import Module Not Working
body: <p>I am very new to Python.</p>
  
  <p>I am in command line and I typed the following:</p>
  
  <pre><code>python -m pip install -U pip
  </code></pre>
  
  <p>Python then starts working inside of command line.</p>
  
  <p>When I type </p>
  
  <pre><code>import pyperclip
  pyperclip.copy('testing')
  pyperclip.paste()
  </code></pre>
  
  <blockquote>
    <p>'Hello World!'</p>
  </blockquote>
  
  <p>is printed.</p>
  
  <p>When I go to the python shell and type</p>
  
  <pre><code>import pyperclip
  pyperclip.copy('testing')
  pyperclip.paste()
  </code></pre>
  
  <p>I get an error message: </p>
  
  <blockquote>
    <p>ModuleNotFoundError: No module named 'pyperclip'</p>
  </blockquote>
  
  <p>How can I figure out where command line is looking when I type import pyperclip and where it is looking in the python shell to compare the two?</p>
  
  <p><strong>Edit #1:</strong></p>
  
  <p>import sys
  sys.path</p>
  
  <p>Seems to be important. I am guessing that when a module is imported, python checks one of those locations.</p>
  
  <p>pyperclip-1.5.7 is now located in one of the paths specified., the "Lib" directory.</p>
  
  <p>pyperclip-1.5.7  looks like this inside of the folder:
  <a href="https://i.stack.imgur.com/PVQvY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PVQvY.png" alt="Inside pyperclip-1.5.7"></a></p>
  
  <p>All of the other modules are located as ".py" files just outside of the pyperclip-1.5.7, maybe I need to move some stuff there. I wonder how I can tell python to check inside of this directory...</p>
  
  <p><strong>Edit #2:</strong></p>
  
  <p>I went to this location: <a href="http://How%20does%20python%20find%20packages?" rel="nofollow noreferrer">https://leemendelowitz.github.io/blog/how-does-python-find-packages.html</a></p>
  
  <p>On the page, the author writes: </p>
  
  <blockquote>
    <p>So Python will find any packages that have been installed to those
    locations.</p>
  </blockquote>
  
  <p>Let's see if I can add something to the sys.path location that points to the specific package that is inside the pyperclip-1.5.7 directory and if that helps.</p>