nbsphinx: WARNING: Pygments lexer name 'ipython3' is not known

I get thousands of warnings:

WARNING: Pygments lexer name 'ipython3' is not known

when I run make html after adding 'nbsphinx' to extensions.

This happens even with an empty index.rst file (it seems to find my .ipynb_checkpoints folder).


python 3.5.1
ipython 4.1.1
nbconvert 4.1.0
jupyter 1.0.0
pygments 2.1

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 7
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I had to add 'IPython.sphinxext.ipython_console_highlighting' to extensions in my conf.py. Somehow the old IPython docs have this info but the new ones don’t.

Adding '**.ipynb_checkpoints' to exclude_patterns fixed the other problem.

Thanks!

A new issue appeared very recently, see #687.

@adamjstewart

ipywidgets should only be required if there are widgets in the notebooks, more specifically, if there is some application/vnd.jupyter.widget-state+json data.

If you have widgets, you somehow have to provide the appropriate JavaScript files, which is done automatically if ipywidgets is available or manually with nbsphinx_widgets_path, see https://nbsphinx.readthedocs.io/en/0.8.9/code-cells.html#Interactive-Widgets-(HTML-only).

If none of your notebooks has any widgets but the warning is still shown, please let me know, because that may be a bug.

And yes, if you want to have code highlighting in code cells, you’ll have to install IPython, see https://nbsphinx.readthedocs.io/en/0.8.9/installation.html#Pygments-Lexer-for-Syntax-Highlighting.

What do you mean by “a bug in its installation procedure”?

expected behavior:

  1. install the ipython package
  2. the 'ipython3' lexer is available without additional actions to be taken

your observed behavior:

  1. install ipython
  2. the 'ipython3' lexer is not available

Therefore, I suspect there is a bug somewhere. I don’t know how the “registration” process of the lexer is supposed to work, but it definitely shows different behavior on different systems.

For me, on Linux/Debian shows the expected behavior. It works also for the automatic build on readthedocs.