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 · 12 comments

Comments

@ostrokach
Copy link

@ostrokach ostrokach commented Feb 22, 2016

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

@ostrokach ostrokach commented Feb 22, 2016

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!

@ostrokach ostrokach closed this Feb 22, 2016
@mgeier

This comment has been minimized.

Copy link
Member

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

IanHawke added a commit to harpolea/r3d2 that referenced this issue May 6, 2016
@nehalecky

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

@mgeier 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 added 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 added 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 added 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 added 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
The issue described in
spatialaudio/nbsphinx#24 seems to be
resolved by ContinuumIO/anaconda-issues#1430
@mgeier

This comment has been minimized.

Copy link
Member

@mgeier mgeier commented Nov 30, 2018

I'm not sure if the Anaconda package is still broken, but this can definitely be solved by using the conda-forge channel.

@timothydmorton

This comment has been minimized.

Copy link

@timothydmorton timothydmorton commented May 10, 2019

FWIW, I have not had problems with syntax highlighting in nbsphinx when I build locally, but I hit this problem when building with nbsphinx on readthedocs. Not sure if this is helpful or not.

@timothydmorton

This comment has been minimized.

Copy link

@timothydmorton timothydmorton commented May 10, 2019

OK, looks like I just needed to add ipython to the requirements.txt; didn't need to add the extension referenced above.

Lnaden added a commit to Lnaden/QCArchiveExamples that referenced this issue Jul 19, 2019
The symptom is that local builds correctly have syntax highlighting
in the output builds, but on RTD, they are lacking.

Based on research from readthedocs/readthedocs.org#5688 the problem
comes from the multiple warnings of:

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

We do see this in our RTD builds as well: https://readthedocs.org/api/v2/build/9139203.txt

Based on that issue and spatialaudio/nbsphinx#24, The fix to this issue is to add
`ipython` to the requirements.txt explicitly. So, this PR tries that
razofz added a commit to razofz/nabo that referenced this issue Sep 12, 2019
- grammatical small changes. Tried to get a more consistent use of words,
  punctuation etc. I tried not to touch sentences where I was unsure of whether
  a change would alter the meaning of the sentence.
- some formatting changes, e. g. markdown lists in the example notebooks didn't
  show in the static html, needed to add a blank line above the lists to get
  them to display properly. NB: in .rst files, there should _not_ be a blank
  line above, if so one loses the 'header' functionality of the line above.
- links to functions in API doc works
- changes to the requirements file:
    - sphinx warned that the `zarr` module was missing and that it could not
      build documentation because of that, so I manually added that module
    - to get the links to functions working (mentioned above), I added to the
      extensions part of the `conf.py` file as per this issue:
      spatialaudio/nbsphinx#24
    - updated the requirements file with `pip freeze -r requirements.txt` to
      preserve the original file. A note for which lines in the requirements
      file that were added by pip freeze was automatically added
- some formatting in docstring so the API documentation site looks/works as it
  should
- replaced a broken link (to miniconda installation instructions)
- updated links to karlssonlab, where the repo now resides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.