jupyter / jupyter-drive

Google drive for jupyter notebooks
BSD 2-Clause "Simplified" License
418 stars 78 forks source link

complexify detection of JUPYTER vs IPYTHON #109

Closed Carreau closed 9 years ago

Carreau commented 9 years ago

getting wether we are on IPython 3.x or Jupyter_notebook 4.x is tricky as the 2 can be installed as the same time. try-import and in sys.modules alone are not sufficient.

rgbkrk commented 9 years ago

Yuck. We probably need a migration helper for other nbextension installers, including @jdfreder's jupyter-pip.

Carreau commented 9 years ago

I kind of imagine it will be simpler for most other project. The problem is I am running with python3 -We so I cannot use the shims. Most other extensions can "just" import from IPython.xxx and the shim take care of that. It's just a good exercise to see how hard it is to support both.

minrk commented 9 years ago

Why is this not

try:
    from jupyter_notebook import nbextensions
except ImportError:
    from IPython.html import nbextensions

?

Carreau commented 9 years ago

Because only the try except was what I had first, but then it fails if you also have a IPython ~ 3 install at the same time.