title: Using .pth files
body: <p>I am trying to make a module discoverable on a system where I don't have write access to the global <code>site-packages</code> directory, and without changing the environment (<code>PYTHONPATH</code>). I have tried to place a <code>.pth</code> file in the same directory as a script I'm executing, but it seems to be ignored. E.g., I created a file <code>extras.pth</code> with the following content: </p>
  
  <pre><code>N:\PythonExtras\lib\site-packages
  </code></pre>
  
  <p>But the following script, placed and run in the same directory, prints <code>False</code>.</p>
  
  <pre><code>import sys
  print r"N:\PythonExtras\lib\site-packages" in sys.paths
  </code></pre>
  
  <p>The only directory in <code>sys.path</code> to which I have write access is the directory containing the script. Is there another (currently non-existent) directory where I could place <code>extras.pth</code> and have it be seen? Is there a better way to go about this?</p>
  
  <p>I'm using python 2.7 on Windows. All <code>.pth</code> questions I could find here use the system module directories.</p>
  
  <p><strong>Edit:</strong> I've tracked down the Windows per-user installation directory, at <code>%APPDATA%\Python\Python27\site-packages</code>. I can place a module there and it will be imported, but if I put a <code>.pth</code> file there, it has no effect. Is this really not supposed to work, or am I doing something wrong?</p>