Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing a jupyter notebook extension

I tried without success to install some extensions to jupyter notebook and can't figure out how to do it. So basically I would like to have pep8 code checking in my notebook. I checked this post: Verifying PEP8 in iPython notebook code

However %install_ext is deprecated so instead I used

jupyter nbextension install https://raw.githubusercontent.com/SiggyF/notebooks/master/pep8_magic.py --user

So I get:

Copying: /tmp/tmpw74yl7m2/pep8_magic.py -> /home/louis/.local/share/jupyter/nbextensions/pep8_magic.py

To initialize this nbextension in the browser every time the notebook (or other app) loads:

          jupyter nbextension enable <the entry point> --user

From now on I could not get it working. I tried:

~$ jupyter nbextension enable pep8_magic.py --user
Enabling notebook extension pep8_magic.py...
      - Validating: problems found:
        - require?  X pep8_magic.py

Without success.

Can someone explain a simple method to get it working and what I missed about jupyter extensions ?

Thank you !

like image 230
Louis M Avatar asked Jan 11 '17 10:01

Louis M


People also ask

How do I install JupyterLab extension?

To install it, just search jupyterlab-drawio or run the command jupyter labextension install jupyterlab-drawio . Then a new “Diagram” icon should show up in the Launcher tab. Click on it to open a new . dio file.

How do you use Jupyter extensions?

After installing, open Jupyter Notebook. You will see a new tab, “Nbextensions” will appear in the menu (as shown in the image). When you click it, you will see a list of available extensions that you can use to increase your productivity of Jupyter Notebook.

What is the file extension for Jupyter notebooks?

Jupyter notebooks have the file extension “. ipynb”. Clicking on files ending with “. ipynb” opens the notebook.

How do I enable Jupyter Notebook extensions in VS code?

Setting up your environment To work with Python in Jupyter Notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you've installed the Jupyter package. To select an environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).


1 Answers

I manually copied the file from the link and then added to /.ipython/extensions (or /nbextensions) and loaded in the notebook: %load_ext pep8_magic

Currently testing but looks fine to me

like image 63
negedng Avatar answered Oct 10 '22 05:10

negedng