title: Installing 3rd party Python modules on an Ubuntu Linux machine?
body: <p>I'm guessing my question is pretty basic, but after 15-20 minutes on Google and YouTube, I am still a little fuzzy. I am relatively new to both Linux and Python, so I am having some difficulty comprehending the file system tree (coming from Windows).</p>
  
  <p>From what I've found digging around the directories in Ubuntu (which is version 12.04, I believe, which I am running in VBox), I have ID'd the following two directories related to Python:</p>
  
  <ol>
  <li><p><code>/usr/local/lib/python2.7</code> which contains these two subdirectories:</p>
  
  <p><code>dist-packages</code><br>
  <code>site-packages</code>  </p>
  
  <p>both of which do not show anything when I type "ls" to get a list of the files therein, but show ". .." when I type "ls -a".</p></li>
  <li><p><code>/usr/lib/python2.7</code> which has no <code>site-packages</code> directory but does have a <code>dist-packages</code> directory that contains many files and subdirectories.</p></li>
  </ol>
  
  <p>So if I want to install a 3rd party Python module, like, say, Mechanize, in which one of the above directories (and which subdirectory), am I supposed to install it in? </p>
  
  <p>Furthermore, I am unclear on the steps to take even after I know where to install it; so far, I have the following planned:</p>
  
  <ol>
  <li>Download the tar.gz (or whatever kind of file the module comes in) from whatever site or server has it</li>
  <li>Direct the file to be unzipped in the appropriate subdirectory (one of the 2 listed above)</li>
  <li>Test to make sure it works via <code>import mechanize</code> in interactive mode.</li>
  </ol>
  
  <p>Lastly, if I want to replace step number 1 above with a terminal command (something like <code>sudo apt-get</code>), what command would that be, i.e., what command via the terminal would equate to clicking on a download link from a browser to download the desired file?</p>