Added a fallback to deprecated IPython.frontend module for IPython

Checks the IPython version to avoid deprecation warning.