54

When I write something in the jupyter notebook markdown field, the typos are not highlighted and often I ended up with something like this:

enter image description here

In almost all IDEs I have used so far, the typos are highlighted with a curly underline which was very convenient for me. Something like this:

enter image description here

Up till now I have not found anything that allows me to see this type of highlights. Does it exist?

Salvador Dali
  • 214,103
  • 147
  • 703
  • 753

3 Answers3

70

The popular Jupyter Notebook bundle extension from Jupyter-contrib contains a spell checker. You can install and enable this (with admin privileges) like so:

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable spellchecker/main

This may be the most popular spell checker for Jupyter Notebooks, but note that it simply highlights words not in its dictionary, and does not offer corrections.

If the extension installed properly, you will see this message in the command line:

enter image description here

Now, in the browser, after opening Jupyter, you will see the button labelled "abc" beside the keyboard button, which you can toggle to enable/disable spell check:

enter image description here

The jupyter-contrib library has many other useful modules such as code folding and table of contents.

Ninjakannon
  • 3,751
  • 7
  • 53
  • 76
Maged Saeed
  • 1,784
  • 2
  • 16
  • 35
  • 13
    Here is how to install `jupyter_contrib_nbextensions` using conda: `conda install -c conda-forge jupyter_contrib_nbextensions` – Makan May 06 '19 at 18:23
  • 1
    Note that you need to run the anaconda prompt "as administrator" to install this or other extensions. – weymouth Sep 30 '20 at 08:54
5

Run the following in a terminal:

ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip
ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-cell-tools-1.0.zip
jupyter nbextension enable calico-spell-check

You can see typos like enter image description here Find out more

Afterwards, you need to activate the spell check in the Jupyter Notebook:

%%javascript
IPython.notebook.config.update({
  "load_extensions": {"calico-spell-check":true,
                      "calico-document-tools":true,
                      "calico-cell-tools":true
                     }
})
Rene B.
  • 6,557
  • 7
  • 46
  • 72
Tony Vincent
  • 13,354
  • 7
  • 49
  • 68
  • 1
    After installing it and invoking your command in the terminal I get: `Enabling notebook extension calico-spell-check... - Validating: OK` but nothing else. When I run jupyter notebook after that my markdown cells are not highlighted – Salvador Dali Sep 05 '16 at 06:51
  • @SalvadorDali do you see any errors in console output ? – Tony Vincent Sep 05 '16 at 07:35
  • any other answer friend , facing the same issue as @SalvadorDali – Hariom Singh Jan 14 '18 at 14:48
3

The spellchecker and some other extensions from jupyter_contrib_nbextensions is incompatible with the ipython version 5.8.0. and later. (Found that it works in some cases for the version 5.0.0 [refer issue page of the same]. I'm not aware of its compatibility for the ipython versions between 5.0.0. to 5.8.0., please do comment if anyone knows). The calico's nbextension 'spellchecker' available at https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip is an outdated version [dated 2015]. But calico had updated their nbextensions and made avaliable at the github repository [latest dated 2018]. It works fine for the ipython version 5.8.0.

Installation

git clone https://github.com/Calysto/notebook-extensions.git
cd notebook-extensions

jupyter nbextension install calysto --user

jupyter nbextension enable calysto/spell-check/main

Check its status:

jupyter nbextension list

When you now open or reload a notebook, there would be a new button visible with a check mark icon next to the button to open the command palette. You may click on it to check the spelling mistakes in the markdown cell.

Faiz K
  • 101
  • 1
  • 7