You can just do this:
Code:
try:
from calibre_plugins.count_pages.common_utils import (get_library_uuid, CustomColumnComboBox,
KeyboardConfigDialog, KeyValueComboBox, PrefsViewerDialog)
except ImportError:
from common_utils import (get_library_uuid, CustomColumnComboBox,
KeyboardConfigDialog, KeyValueComboBox, PrefsViewerDialog)
And if you want to detect if you are running in a full calibre environment, use this:
Code:
import sys
in_calibre = hasattr(sys, 'extensions_location')