title: "import site' failed; use -v for traceback" - mac os lion, python 2.7, subprocess
body: <p>I'm trying to run a subprocess in python, this a part from my code:</p>
  
  <pre><code>def update(self):
          currentTime = strftime("%d.%m.%y %H:%M", gmtime()) #strftime("%d-%m-%y %H:%M", gmtime)
          resultString = "======== " + currentTime + " ========\n\n"  
          bzrMergeCommand = "cd %s ; /usr/local/bin/bzr merge" % self._directoryName
          print "Getting the updated code from bzr..."
          mergeResult = sp.Popen(bzrMergeCommand, shell=True, stdout=sp.PIPE, stderr=sp.PIPE, cwd= self._directoryName)
  
          communicated = mergeResult.communicate()
  </code></pre>
  
  <p>But it fail to run and this is the exception I got:</p>
  
  <pre><code> 'import site' failed; use -v for traceback Traceback (most recent call
   last):   File "/usr/local/bin/bzr", line 21, in &lt;module&gt;
       import os   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py",
   line 398, in &lt;module&gt;
       import UserDict   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py",
   line 84, in &lt;module&gt;
       _abcoll.MutableMapping.register(IterableUserDict)   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py",
   line 109, in register
       if issubclass(subclass, cls):   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py",
   line 151, in __subclasscheck__
       if subclass in cls._abc_cache:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py",
   line 69, in __contains__
       return ref(item) in self.data TypeError: cannot create weak reference to 'classobj' object
  </code></pre>
  
  <p>I googled and read alot regarding "TypeError: cannot create weak reference to 'classobj' object":
  <a href="https://stackoverflow.com/questions/7753181/making-my-python-script-executable-causes-a-import-site-failed-use-v-for-tra">https://stackoverflow.com/questions/7753181/making-my-python-script-executable-causes-a-import-site-failed-use-v-for-tra</a></p>
  
  <p>and here: <a href="https://github.com/pypa/virtualenv/issues/108" rel="nofollow noreferrer">https://github.com/pypa/virtualenv/issues/108</a></p>
  
  <p>Any idea?</p>