-
Notifications
You must be signed in to change notification settings - Fork 569
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
No Pygments lexer found for "ipython3" #528
Comments
OK, a quick test shows that neither |
@mgeier FYI wrt nbsphinx#24. |
Pygments, which does the syntax highlighting, tries to look up a lexer that is provided by IPython. My guess would be that you have IPython and Sphinx installed in two different Pythons, or Python environments, so the one running Sphinx cannot find IPython. If that is the problem, then the fix is to either install Sphinx into the Python where you use IPython, or vice versa. |
Multiple users of I don't know what's going on, since I didn't experience those problems myself. It also always worked on readthedocs.org. A common work-around is to add @takluyver I have the feeling that it is more subtle than inadvertently installing IPython and Sphinx for different Python interpreters. It probably has to do with the order of installation or something? |
Order of installation shouldn't matter. I suspect it might be quite common to have Sphinx on Python 2, for instance if you've installed it from apt. Pygments also needs pkg_resources to find it, but that should be available in most Pythons. @ResidentMario can you run this in IPython, and put it in conf.py for Sphinx to run: from pygments.plugin import find_plugin_lexers
print(list(find_plugin_lexers())) |
Also, just to check a couple of things: import pkg_resources # See if it fails with an ImportError
import sys
print(sys.executable) |
With regards to
With regards to the Running...
...in the Inserting...
...into
|
I think I see the issue. Can you try installing the IPython built by conda-forge:
|
This is, indeed, the fix. FYI, the
So (ignoring issues about the interplay between the default channel and |
I don't think it's an issue with pygments, but the You may want to file an issue on anaconda-issues, pointing them to the recipe on conda-forge. |
Done. |
I'm not sure whether to raise this here or over at
sphinx
. Here goes.I'm writing documentation for a library. The tutorials for the documentation I am writing in a handful of Jupyter notebooks, which I then emit to the rest of the documentation using
nbconvert
. Since this is tedious to do manually, I've written a small script that does it for me. The core of it is justjupyter nbconvert
with a--to rst
argument.Everything was working until I updated some things today and discovered that my notebook code cells were no longer displaying.
Here is an example of a page which should have multiple code blocks on it . As you can see, the output of each cell displays just fine, but the input has disappeared.
To verify this, click on the Source button on the UI; this will bring you to here, which shows that the code is still embedded in the
RST
representation:But that it disappears on the HTML source, which gets translated to:
Checking the console output from when I run
make html
to build the docs, I see that indeed I am getting numerous warnings to the effect of:Note that all of this worked circa a month ago.
My best guess is that the
sphinx
pygments
lexar has dropped support foripython3
due to IPython 3.x being comparatively ancient technology at this point. However,nbconvert
has not been updated to reflect this fact.Perhaps changing the export prompt to
ipython4
orjupyter
(?) would work.The text was updated successfully, but these errors were encountered: