place logpy imports in try-except blocks