Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing jupyter-contrib-nbextension on Google Colab

I wanted to install hinterland for use in google colab. I followed the installation instructions on official page

Basically I did the following steps:

!pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
!jupyter contrib nbextension install --user

Now when I want to enable any particular extension say 'hinterland' I do the following:

!jupyter nbextension enable  /usr/local/lib/python3.6/dist-packages/jupyter_contrib_nbextensions/nbextensions/hinterland/hinterland.js

But this gives me an error saying:

Enabling notebook extension /usr/local/lib/python3.6/dist-packages/jupyter_contrib_nbextensions/nbextensions/hinterland/hinterland.js...
  - Validating: problems found:
    - require?  X /usr/local/lib/python3.6/dist-packages/jupyter_contrib_nbextensions/nbextensions/hinterland/hinterland.js

How do I fix this? Am I going wrong in any step?

Or is there any other better way of installing these extensions specifically for google colab.

like image 413
Nikhil Mishra Avatar asked Sep 12 '18 09:09

Nikhil Mishra


People also ask

How do I install nbextension in Jupyter?

jupyter contrib nbextension install --user The command does two things: installs nbextension files, and edits nbconvert config files. The first part is essentially a wrapper around the notebook-provided jupyter nbextension install, and copies relevant javascript and css files to the appropriate jupyter data directory.

How do I connect CoLab to Jupyter?

In Colab, click the “Connect” button and select “Connect to local runtime”. Enter the URL you just copied and click “Connect”: That’s it! You now have the Colab research environment running on your local Jupyter server.

What is the extension of a Jupyter Notebook?

Notebook files have the extension ".ipynb" extension. A Jupyter notebook is one of many environments you may run Python code. Colab and the Jupyter notebook editor in Anaconda are two of the many pieces of software you may use to write and run a Jupyter notebook.

Can I run code in a Jupyter Notebook?

When a Jupyter Notebook is shared with you on Colab, you will often receive access to the notebook which will alow you to run code, but not edit it. This should be the case for the notebooks that form part of this course.


1 Answers

Just run !jupyter nbextension enable hinterland/hinterland: enter image description here

like image 166
prudenko Avatar answered Nov 15 '22 10:11

prudenko