title: xvfbwrapper import error with alternate python installation
body: <p>xvfbwrapper requires python2.7 or up.</p>
  
  <p>I have a script that does this:</p>
  
  <pre><code>from xvfbwrapper import Xvfb
  </code></pre>
  
  <p>I have python2.7 installed as an alternate installation of python because my OS (centOS 6.4) requires 2.6. When I run the script like this: </p>
  
  <pre><code>python2.7 some_script.py
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>ImportError: cannot import name Xvfb
  </code></pre>
  
  <p>This baffles me because the correct version of python is executing the script. It seems that the imported modules are trying to use the system version. If I change the python executable from /usr/local/bin/python2.7 to /usr/local/bin/python, I can open up the console and run the same import statement without getting the error if I ensure there are no byte code compiled files of the module from a previously failed execution, probably compiled with python2.6 for whatever reason.</p>
  
  <p>It seemed like a path issues so I tried putting /usr/local/bin at the top of PATH and changing the name of python2.7 to python but no dice.</p>
  
  <p>Any ideas about what is happening? I'm pulling my hair out trying to figure this out.</p>
  
  <p>Thanks so much.</p>
  
  <p>UPDATE:</p>
  
  <p>xvfbwrapper was installed with:</p>
  
  <pre><code>pip-2.7 install xvfbwrapper
  </code></pre>
  
  <p>The same issue exists with virtualenv. *In the following example, some_script.py is simply an import statement:</p>
  
  <pre><code>""" some_script.py """
  from xvfbwrapper import Xvfb
  </code></pre>
  
  <p>I ran the following commands:</p>
  
  <pre><code>$ virtualenv --no-site-packages --python=/usr/local/bin/python2.7 venv
  $ source ./venv/bin/activate
  $ pip install xvfbwrapper
  $ python -v some_script.py
  </code></pre>
  
  <p>The partial output:</p>
  
  <pre><code>import xvfbwrapper # directory /home/projects/process/venv/lib/python2.7/site-packages/xvfbwrapper
  # /home/projects/process/venv/lib/python2.7/site-packages/xvfbwrapper/__init__.pyc matches        /home/projects/process/venv/lib/python2.7/site-packages/xvfbwrapper/__init__.py
  import xvfbwrapper # precompiled from /home/projects/process/venv/lib/python2.7/site-packages/xvfbwrapper/__init__.pyc
  Traceback (most recent call last):
  File "some_script.py", line 2, in &lt;module&gt;
      from xvfbwrapper import Xvfb
  ImportError: cannot import name Xvfb
  </code></pre>
  
  <p>exact python version is 2.7.3
  The xvfbwrapper module definitely has Xvfb class defined. I use the same module on a different system without any issues and it is the same version. (xvfbwrapper version 0.2.3)</p>
  
  <p>To provide a little bit more context to the nature of the oddity: I can run the python console  within the above virtual environment and successfully execute the same command.</p>
  
  <p>UPDATE:</p>
  
  <pre><code>python2.7 -c "import sys; print sys.path"
  </code></pre>
  
  <p>The command outputs (*this is the system python, not the virtualenv):</p>
  
  <pre><code>['',
  '/usr/local/lib/python2.7/site-packages/supervisor-3.0-py2.7.egg', 
  '/usr/local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg', 
  '/usr/local/lib/python2.7/site-packages/virtualenv-1.10.1-py2.7.egg', 
  '/usr/local/lib/python2.7/site-packages/distribute-0.7.3-py2.7.egg', 
  '/usr/local/lib/python2.7/site-packages/setuptools-1.1.6-py2.7.egg', 
  '/usr/local/lib/python27.zip', 
  '/usr/local/lib/python2.7', 
  '/usr/local/lib/python2.7/plat-linux2', 
  '/usr/local/lib/python2.7/lib-tk', 
  '/usr/local/lib/python2.7/lib-old', 
  '/usr/local/lib/python2.7/lib-dynload', 
  '/usr/local/lib/python2.7/site-packages']
  </code></pre>
  
  <p>within the virtualenv created:</p>
  
  <pre><code>['', 
  '/home/projects/process/venv/lib/python27.zip', 
  '/home/projects/process/venv/lib/python2.7', 
  '/home/projects/process/venv/lib/python2.7/plat-linux2', 
  '/home/projects/process/venv/lib/python2.7/lib-tk',     
  '/home/projects/process/venv/lib/python2.7/lib-old', 
  '/home/projects/process/venv/lib/python2.7/lib-dynload', 
  '/usr/local/lib/python2.7', 
  '/usr/local/lib/python2.7/plat-linux2', 
  '/usr/local/lib/python2.7/lib-tk', 
  '/home/projects/process/venv/lib/python2.7/site-packages']
  </code></pre>