Skip to content

Instantly share code, notes, and snippets.

@numberwhun
Created June 28, 2013 18:41
Show Gist options
  • Save numberwhun/5886985 to your computer and use it in GitHub Desktop.
Save numberwhun/5886985 to your computer and use it in GitHub Desktop.
Code for importing a module other than something in the standard library. Anything in < > needs to be replaced (including removing the < >).
try:
import <module>
except ImportError:
print '<module> module required. Please install with "pip install <module>"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment