Comment 5 for bug 719091

Revision history for this message
Roger Binns (ubuntu-rogerbinns) wrote :

I just got bitten by this as well.

The easy fix is to modify startup to put openshot/uploads/youtube at the beginning of sys.path . Any imports after that will pick your bundled version.

In my own projects what I do is have a toplevel directory named 'thirdparty' which then has modules like this in it. I then have a module named 'usethirdparty' which looks like this:

   import sys
   import os
   sys.path=[os.path.join(os.path.dirname(os.path.abspath(__file__)), "thirdparty")]+sys.path

Elsewhere in my code the imports section looks like this:

  import sys
  import this

  import usethirdparty
  import gdata

Having usethirdparty as a module ensures it only gets run once. The imports make the author's intentions clear. The approach works on all version of python from 2.3 onwards.