-
Notifications
You must be signed in to change notification settings - Fork 18
Description
The “Quick-and-dirty trick” to fix #7 is too dirty for my taste.
For my add-on i came up with what i think is reasonably clever code to use a site packages when it is installed and to ignore that when it’s not there, basically
try:
from pydub.silence import detect_nonsilent
# Look for a reasonable new pydub
except ImportError:
processor = None
else:
from .audio_processor import AudioProcessor
processor = AudioProcessor()And later just use if processor to either use this code or not.
The problem is that the import will never work, because your add-on removed the directory where the site packages is from the search path.
I guess my branch is not really a solution. That would be back to square one, or issue #7.
Afaik the problem is different versions of several libraries your add-on brings along. (Although i can’t find cjklib any more.)
Maybe it works when you leave the paths alone and use relative imports like from .python-2.7-modules import md5 instead of plain import md5. Note the dot before the pytho-2.7-modules. (I have not tried this. Just a general idea.)