python module in different version code example
Example: import different module based on python version
try:
import simplejson as json
except ImportError:
import json
try:
import simplejson as json
except ImportError:
import json