title: How to include third party Python packages in Sublime Text 2 plugins
body: <p>I'm writing a sublime text 2 plugin that uses a module <a href="https://stackapps.com/questions/3881/se-api-py-a-lightwight-python-wrapper-for-se-api">SEAPI.py</a> which in itself imports the <a href="http://docs.python-requests.org/en/latest/" rel="noreferrer">requests module</a>.</p>
  
  <p>Since sublime text 2 uses it's own embedded python interpreter, it doesn't see the requests module installed in my ubuntu machine (I get the following error: ImportError: No module named requests).</p>
  
  <p>Best solution I could find so far was to copy the 'requests' module (the whole directory of files) from /usr/lib/python2.7/dist-packages/requests into my plugin directory in the sublime text packages dir.
  But after that, it says that it can't find the 'urllib3' module.</p>
  
  <p>Is there a better way to import the requests module so that I won't have to copy all the files into my plugin directory ?</p>
  
  <p>The current code I'm using is as follows:</p>
  
  <p>MyPlugin.py</p>
  
  <pre><code>import sublime
  import sublime_plugin
  import SEAPI
  ...
  </code></pre>
  
  <p>SEAPI.py</p>
  
  <pre><code>import requests
  try:
      import simplejson as json
  except:
      import json
  from time import time, sleep
  ...
  </code></pre>
  
  <p><strong>Edit:</strong>
  The selected answer is correct and fixes my main question, but a different problem exists with using the current version of 'Requests' with the embedded sublime text 2 interpreter. ST2's python is missing various modules which exist in regular 2.7 python (such as 'fileio').</p>
  
  <p>I've solved it with using the 'Requests' module from here:
  <a href="https://github.com/bgreenlee/sublime-github" rel="noreferrer">https://github.com/bgreenlee/sublime-github</a></p>
  
  <p>And I had to edit the 'urllib3/response.py' file to this:</p>
  
  <pre><code>try:
      from cStringIO import StringIO as BytesIO
  except ImportError:
      pass  # _fileio doesn't seem to exist in ST's python in Linux, but we don't need it
  </code></pre>