title: Telling __import__ where to look - am I stuck with sys.path?
body: <p>I have a project in pure Python with a rudimentary plugin system: you write a module that defines a class with a specific interface and name, and the program imports the module and subsequently instantiates the class as needed.</p>
  
  <p>Currently, the plugins all come from a specific folder (subdirectory of where the main .py file is located). I would like to be able to have them elsewhere on disk, and instruct the program to look for plugins in a specific place. Can I do this, for one-off dynamic imports, in a cleaner way than modifying <code>sys.path</code>? I don't want to pollute this global.</p>
  
  <p>Related: can I count on <code>sys.path[0]</code> being the path to the script, even if that differs from the current working directory (<code>os.getcwd()</code>)?</p>
  
  <p>EDIT: I forgot to mention - I want to be able to get plugins from several different folders, with the user specifying paths to plugin folders. Currently, each of these folders is set up as a package (with an <code>__init__.py</code>); I can trivially scrap this if it causes a problem.</p>