Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Pygments lexer name 'ipython3' is not known #24

Closed
ostrokach opened this issue Feb 22, 2016 · 17 comments
Closed

WARNING: Pygments lexer name 'ipython3' is not known #24

ostrokach opened this issue Feb 22, 2016 · 17 comments

Comments

@ostrokach
Copy link

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
@mgeier
Copy link
Member

mgeier commented Feb 22, 2016

Hmm, for me this has always worked; the lexer should be part of the "IPython" package: http://ipython.readthedocs.org/en/stable/development/lexer.html.

Can you try to re-install this package?

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

Yes, Sphinx searches the whole source directory (including subfolders) for notebook files and parses all of them, regardless of what's in your index.rst. You should probably add something like this to your conf.py:

exclude_patterns = ['_build', '**.ipynb_checkpoints']

See http://nbsphinx.readthedocs.org/en/latest/usage.html.

@ostrokach
Copy link
Author

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!

@mgeier
Copy link
Member

mgeier commented Feb 22, 2016

Good to know that you found a solution that works for you!

But still, IMHO the ipython3 lexer should work automatically.
I've never used ipython_console_highlighting (or anything else) explicitly and it just works.
I think this should be somehow be automatically registered when installing the IPython package.

@nehalecky
Copy link

nehalecky commented Jul 20, 2016

FWIW: I'm also hitting this same warning when building the documentation of the the nbsphinx repo. After cloning and installing dependencies, I run sphinx-build -b html doc doc/html whilc checked out to version 0.2.8.

The fix proposed by @ostrokach :

I had to add 'IPython.sphinxext.ipython_console_highlighting' to extensions in my conf.py.

also worked for me, warnings are gone.

Thanks!

@michaelaye
Copy link

michaelaye commented Dec 16, 2016

The advise of

adding 'IPython.sphinxext.ipython_console_highlighting' to extensions in my conf.py

is not in the installation instructions yet, should it be added? I also receive this warning

/Users/klay6683/Dropbox/src/pyciss/docs/examples.ipynb:: WARNING: Pygments lexer name 'ipython3' is not known

multiple times for a single almost empty notebook and adding the above extension removed (masked?) that warning.

@mgeier
Copy link
Member

mgeier commented Dec 18, 2016

@michaelaye If you get the warning even if you have the ipython package installed, this is IMHO a bug in its installation procedure. I'm re-opening this issue as a reminder.

Adding the IPython.sphinxext.ipython_console_highlighting extension is only a work-around, but not the real solution of the problem.

We can add a hint regarding the work-around to the docs (feel free to make a PR!), but it would be also very good to find the actual cause for the problem (and solve it).

@mgeier mgeier reopened this Dec 18, 2016
@mgeier mgeier added the bug label Dec 18, 2016
@adrn
Copy link
Contributor

adrn commented Jan 10, 2017

I'm getting the same warnings. I set up a fresh conda environment, installed all packages as described in http://nbsphinx.readthedocs.io/en/0.2.12/usage.html

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

@mgeier
Copy link
Member

mgeier commented Jan 10, 2017

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.

@mgeier
Copy link
Member

mgeier commented Feb 7, 2017

So the reason might be a buggy Anaconda package: ContinuumIO/anaconda-issues#1430

danking added a commit to danking/hail that referenced this issue Apr 19, 2017
danking added a commit to danking/hail that referenced this issue Apr 19, 2017
tpoterba pushed a commit to hail-is/hail that referenced this issue Apr 19, 2017
* eliminate warning in getting_started.rst

* all warnings are errors

* use anonymous links instead of named links

* fix indentation of list item

* fix a variety of list item syntax issues

* remove illegal excess indentation

* several list item syntax fixes

* variety of list item fixes and a link fix

* remove extraneous character from string [] docs

* favicons must end in ico

* work around a bug in conda

Discussion of issue:

  spatialaudio/nbsphinx#24 (comment)

Root cause:

  ContinuumIO/anaconda-issues#1430

* fix link to tutorial

* fix broken links

* remove broken link to sample

* remove more broken links to sample

* remove references to sec-objects

* fix bad reference syntax

* two small fixes

1. Remove reference to sample
2. Move ico to correct directory

* remove unnecessary html_extra_path entry

* fix doctest skip syntax
cseed pushed a commit to hail-is/hail that referenced this issue Apr 21, 2017
…1691)

* eliminate warning in getting_started.rst

* all warnings are errors

* use anonymous links instead of named links

* fix indentation of list item

* fix a variety of list item syntax issues

* remove illegal excess indentation

* several list item syntax fixes

* variety of list item fixes and a link fix

* remove extraneous character from string [] docs

* favicons must end in ico

* work around a bug in conda

Discussion of issue:

  spatialaudio/nbsphinx#24 (comment)

Root cause:

  ContinuumIO/anaconda-issues#1430

* fix link to tutorial

* fix broken links

* remove broken link to sample

* remove more broken links to sample

* remove references to sec-objects

* fix bad reference syntax

* two small fixes

1. Remove reference to sample
2. Move ico to correct directory

* remove unnecessary html_extra_path entry

* initial attempt

* add missing file

* improve hailType blurb

* further improvements from tpoterba

* Update hailType.rst

* sphinx lists must not have leading space

This triggers an error message:

    Error in "include" directive: no content permitted.

because the one-space-indented text is assumed to be an argument to the
`.. include` directive

Also fix location of hailType.rst

* use anonymous links instead of named links

* simplify docs
liameabbott pushed a commit to liameabbott/hail that referenced this issue May 3, 2017
* eliminate warning in getting_started.rst

* all warnings are errors

* use anonymous links instead of named links

* fix indentation of list item

* fix a variety of list item syntax issues

* remove illegal excess indentation

* several list item syntax fixes

* variety of list item fixes and a link fix

* remove extraneous character from string [] docs

* favicons must end in ico

* work around a bug in conda

Discussion of issue:

  spatialaudio/nbsphinx#24 (comment)

Root cause:

  ContinuumIO/anaconda-issues#1430

* fix link to tutorial

* fix broken links

* remove broken link to sample

* remove more broken links to sample

* remove references to sec-objects

* fix bad reference syntax

* two small fixes

1. Remove reference to sample
2. Move ico to correct directory

* remove unnecessary html_extra_path entry

* fix doctest skip syntax
liameabbott pushed a commit to liameabbott/hail that referenced this issue May 3, 2017
…ail-is#1691)

* eliminate warning in getting_started.rst

* all warnings are errors

* use anonymous links instead of named links

* fix indentation of list item

* fix a variety of list item syntax issues

* remove illegal excess indentation

* several list item syntax fixes

* variety of list item fixes and a link fix

* remove extraneous character from string [] docs

* favicons must end in ico

* work around a bug in conda

Discussion of issue:

  spatialaudio/nbsphinx#24 (comment)

Root cause:

  ContinuumIO/anaconda-issues#1430

* fix link to tutorial

* fix broken links

* remove broken link to sample

* remove more broken links to sample

* remove references to sec-objects

* fix bad reference syntax

* two small fixes

1. Remove reference to sample
2. Move ico to correct directory

* remove unnecessary html_extra_path entry

* initial attempt

* add missing file

* improve hailType blurb

* further improvements from tpoterba

* Update hailType.rst

* sphinx lists must not have leading space

This triggers an error message:

    Error in "include" directive: no content permitted.

because the one-space-indented text is assumed to be an argument to the
`.. include` directive

Also fix location of hailType.rst

* use anonymous links instead of named links

* simplify docs
bocklund added a commit to pycalphad/pycalphad that referenced this issue Nov 27, 2017
Examples built from Jupyter notebooks use ipython3 in RST code blocks.
This means ipython must be installed for sphinx (particularly
pygments) to pick up the correct lexer. See
spatialaudio/nbsphinx#24
bocklund added a commit to pycalphad/pycalphad that referenced this issue Nov 30, 2017
Examples built from Jupyter notebooks use ipython3 in RST code blocks.
This means ipython must be installed for sphinx (particularly
pygments) to pick up the correct lexer. See
spatialaudio/nbsphinx#24
bryanwweber added a commit to bryanwweber/thermostate that referenced this issue Oct 20, 2018
@mgeier
Copy link
Member

mgeier commented Jul 23, 2022

@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.

thewtex added a commit to thewtex/ITKSphinxExamples that referenced this issue Dec 2, 2022
To address:

```
ConvertNumPyArrayToitkImage.ipynb:: WARNING: Pygments lexer name 'ipython3' is not known
```

per:

- spatialaudio/nbsphinx#24

Also install ipywidgets for general use in the Superbuild.
eltos added a commit to xsuite/xplt that referenced this issue Dec 3, 2022
J535D165 added a commit to asreview/asreview that referenced this issue Dec 5, 2022
J535D165 added a commit to asreview/asreview that referenced this issue Dec 5, 2022
thewtex added a commit to thewtex/ITKSphinxExamples that referenced this issue Dec 5, 2022
To address:

```
ConvertNumPyArrayToitkImage.ipynb:: WARNING: Pygments lexer name 'ipython3' is not known
```

per:

- spatialaudio/nbsphinx#24

Also install ipywidgets for general use in the Superbuild.
@Bilokin
Copy link

Bilokin commented Dec 6, 2022

Hello, I have the same issue as @adamjstewart and my code highlight in the jupyter pages doesn't work and it broke a few days or weeks ago.
Example: https://syscorrfw.readthedocs.io/en/latest/particleid_weight_production.html
Is this issue already being worked on?
Which steps should I take to resolve it for my package?

@mgeier
Copy link
Member

mgeier commented Dec 6, 2022

A new issue appeared very recently, see #687.

matteobachetti added a commit to StingraySoftware/stingray that referenced this issue Dec 14, 2022
See spatialaudio/nbsphinx#24 and references/citations therein
rlouf added a commit to rlouf/blackjax that referenced this issue Dec 15, 2022
It appears that this is necessary for Pygments' syntax highlighting to
work with the executed notebooks: spatialaudio/nbsphinx#24
bernstei added a commit to libAtoms/workflow that referenced this issue Dec 19, 2022
wildintellect added a commit to MAAP-Project/maap-documentation that referenced this issue Apr 10, 2023
Also modified conf.py to fix ipython3 highlight issue spatialaudio/nbsphinx#24
junpenglao pushed a commit to blackjax-devs/blackjax that referenced this issue Mar 12, 2024
It appears that this is necessary for Pygments' syntax highlighting to
work with the executed notebooks: spatialaudio/nbsphinx#24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants