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

replace template_path with template_paths #1532

Merged
merged 16 commits into from
Apr 5, 2021
Merged

replace template_path with template_paths #1532

merged 16 commits into from
Apr 5, 2021

Conversation

demotu
Copy link
Contributor

@demotu demotu commented Sep 29, 2020

Nbconvert 6.0 replaced 'template_path' with 'template_paths' (see https://nbconvert.readthedocs.io/en/latest/changelog.html#significant-changes).
This change in Nbconvert causes errors in jupyter_latex_envs and in jupyter_contrib_nbextensions (see #1529).

Replacing all instances of 'template_path' with 'template_paths' in both jupyter_latex_envs and in jupyter_contrib_nbextensions fixes the error.

@demotu
Copy link
Contributor Author

demotu commented Sep 29, 2020

Update changelog file with the changes of pr #1532

@stefansimik
Copy link

Update changelog file with the changes of pr #1532

I appreciate the PR. Some CI checks are still failing, for example with this error:

ERROR: Could not find a version that satisfies the requirement nbconvert>=6.0 (from jupyter-contrib-nbextensions==0.5.1) (from versions: 4.0.0, 4.1.0, 4.2.0, 4.3.0, 5.0.0b1, 5.0.0, 5.1.0, 5.1.1, 5.2.1, 5.3.0, 5.3.1, 5.4.0, 5.4.1.dev0, 5.4.1, 5.5.0, 5.6.0, 5.6.1)
ERROR: No matching distribution found for nbconvert>=6.0 (from jupyter-contrib-nbextensions==0.5.1)

Would you be so kind please and could check why it cannot pass?

@demotu
Copy link
Contributor Author

demotu commented Oct 23, 2020

Update changelog file with the changes of pr #1532

I appreciate the PR. Some CI checks are still failing, for example with this error:

ERROR: Could not find a version that satisfies the requirement nbconvert>=6.0 (from jupyter-contrib-nbextensions==0.5.1) (from versions: 4.0.0, 4.1.0, 4.2.0, 4.3.0, 5.0.0b1, 5.0.0, 5.1.0, 5.1.1, 5.2.1, 5.3.0, 5.3.1, 5.4.0, 5.4.1.dev0, 5.4.1, 5.5.0, 5.6.0, 5.6.1)
ERROR: No matching distribution found for nbconvert>=6.0 (from jupyter-contrib-nbextensions==0.5.1)

Would you be so kind please and could check why it cannot pass?

The problem is that nbconvert 6.1 dropped support for Python 3.6 (https://nbconvert.readthedocs.io/en/latest/install.html#supported-python-versions) and all the CI checks are for Python < 3.7.
Since the current versions of Python and nbconvert in the default Anaconda Installers are now 3.8 and 6.1 (I think), I'd argue that jupyter_contrib_nbextensions default release should also be compatible with these versions.
So, .travis.yml should include tests for Python 3.7 and 3.8 and drop older tests (at least for the latest version).

@demotu
Copy link
Contributor Author

demotu commented Oct 25, 2020

Update changelog file with the changes of pr #1532

I appreciate the PR. Some CI checks are still failing, for example with this error:

ERROR: Could not find a version that satisfies the requirement nbconvert>=6.0 (from jupyter-contrib-nbextensions==0.5.1) (from versions: 4.0.0, 4.1.0, 4.2.0, 4.3.0, 5.0.0b1, 5.0.0, 5.1.0, 5.1.1, 5.2.1, 5.3.0, 5.3.1, 5.4.0, 5.4.1.dev0, 5.4.1, 5.5.0, 5.6.0, 5.6.1)
ERROR: No matching distribution found for nbconvert>=6.0 (from jupyter-contrib-nbextensions==0.5.1)

Would you be so kind please and could check why it cannot pass?

The problem is that nbconvert 6.1 dropped support for Python 3.6 (https://nbconvert.readthedocs.io/en/latest/install.html#supported-python-versions) and all the CI checks are for Python < 3.7.
Since the current versions of Python and nbconvert in the default Anaconda Installers are now 3.8 and 6.1 (I think), I'd argue that jupyter_contrib_nbextensions default release should also be compatible with these versions.
So, .travis.yml should include tests for Python 3.7 and 3.8 and drop older tests (at least for the latest version).

To correct myself, the current version of nbconvert is 6.0.7, and according to its documentation:
"nbconvert 6.0 provides limited support for Python 3.6. nbconvert 6.1 will drop support for Python 3.6. Limited support means we will test and run CI on Python 3.6.12 or higher. Issues that are found only affecting Python 3.6 are not guaranteed to be fixed. We recommend all users of nbconvert use Python 3.7 and higher."

@stefansimik
Copy link

stefansimik commented Oct 25, 2020

Hi @demotu
in reference to:

So, .travis.yml should include tests for Python 3.7 and 3.8 and drop older tests

Do you have any idea, who could be capable / allowed doing this for this repo?

@demotu
Copy link
Contributor Author

demotu commented Oct 26, 2020

Hi @demotu
in reference to:

So, .travis.yml should include tests for Python 3.7 and 3.8 and drop older tests

Do you have any idea, who could be capable / allowed doing this for this repo?

I think we just have to change the .travis.yml file; I will do that in my fork and I let you know.

One detail is that I think the warning messages shown in #1529 (comment) are in fact generated by the jupyter_latex_envs extension, which has also to change to 'template_paths' (related pull request there, jfbercher/jupyter_latex_envs#58).
So, even after you accept the pull request here, the warning messages will still appear until jupyter_latex_envs also accept the PR there (and any other extension using 'template_path' instead of 'template_paths' and someway linked to nbconvert, but it seems to be just these two extensions).

@proinsias
Copy link

@demotu / @stefansimik – any update on this?

@stefansimik
Copy link

@demotu / @stefansimik – any update on this?

Only @demotu can save us :-)

@demotu
Copy link
Contributor Author

demotu commented Dec 1, 2020

promise I will do it in two days.

tests for python versions: 3.6, 3.7, 3.8
tests only for notebook 6.0.0
part of the tests using python 3.8 and notebook 6.0.0
drop support for python 2.x
requires notebook >=6.0
drop support for python < 3.6
supports only PYTHON_ARCH: '64'
Drop support for python < 3.6
Drop support for python < 3.6
Drop support for python < 3.6
@demotu
Copy link
Contributor Author

demotu commented Dec 3, 2020

I didn't notice I was also committing to master all the time. Some of the previous CI tests failed for strange reasons, but jupyter_contrib_nbextensions '0.5.2' runs fine in my local installation with linux, miniconda, python 3.8.6 and notebook 6.1.5.
let's see the latest CI tests.

@demotu
Copy link
Contributor Author

demotu commented Dec 3, 2020

Most of the CI tests fail with message (https://travis-ci.org/github/ipython-contrib/jupyter_contrib_nbextensions/jobs/747348271):
jinja2.exceptions.TemplateNotFound: ...

It seems it's a common error using jinja2, e.g.:
https://www.google.com/search?q=jinja2.exceptions.TemplateNotFound

I will try to fix.

@marhoy
Copy link

marhoy commented Feb 18, 2021

Any plans for merging this?

@stefansimik
Copy link

Any plans for merging this?
Yeah, that would be awesome.
I am also waiting for this merge, checking weekly 😉

@juhasch
Copy link
Member

juhasch commented Apr 5, 2021

Sorry for the long wait. Merging and trying to fix the CI tests afterwards.

@juhasch juhasch merged commit 75c2b6e into ipython-contrib:master Apr 5, 2021
@stefansimik
Copy link

Thank you @juhasch
Looks like it is not an easy task to fix the CI tests ...

@fip17
Copy link

fip17 commented May 7, 2022

Still seeing this problem in 2022-05. Multiple error messages on starting up Jupyter Lab:
[W 2022-05-07 11:15:01.416 ServerApp] Config option template_path not recognized by ExporterCollapsibleHeadings. Did you mean one of: extra_template_paths, template_name, template_paths?
[W 2022-05-07 11:15:01.471 ServerApp] Config option template_path not recognized by TocExporter. Did you mean one of: extra_template_paths, template_name, template_paths?
[W 2022-05-07 11:15:01.496 ServerApp] Config option template_path not recognized by LenvsHTMLExporter. Did you mean one of: extra_template_paths, template_name, template_paths?

@stefansimik
Copy link

Still seeing this problem in 2022-05. Multiple error messages on starting up Jupyter Lab: [W 2022-05-07 11:15:01.416 ServerApp] Config option template_path not recognized by ExporterCollapsibleHeadings. Did you mean one of: extra_template_paths, template_name, template_paths? [W 2022-05-07 11:15:01.471 ServerApp] Config option template_path not recognized by TocExporter. Did you mean one of: extra_template_paths, template_name, template_paths? [W 2022-05-07 11:15:01.496 ServerApp] Config option template_path not recognized by LenvsHTMLExporter. Did you mean one of: extra_template_paths, template_name, template_paths?

Yeah, that's true.
This basic thing in Jupyterlab is broken for 1 year.

@K20shores
Copy link

So what still needs to be done to fix this? With a clean install (done yesterday), removing all of the old config files, and replacing template_path with template_paths in the directories after they are made, I still see all of these warning messages. Is it because this package has not done a release since 2019?

@stefansimik
Copy link

So what still needs to be done to fix this? With a clean install (done yesterday), removing all of the old config files, and replacing template_path with template_paths in the directories after they are made, I still see all of these warning messages. Is it because this package has not done a release since 2019?

Exactly, with clean install, it still does not work.
After a lot of frustration, with basic things not working,
I decided to go with Quarto and do not rely on exports using jupyter-contrib-nbextensions + nbconvert

@juhasch
Copy link
Member

juhasch commented Dec 10, 2022

The template_path problems should be fixed now in the jupyter-nbextensions-configurator. There is a PyPi release for this. We are still trying to get a new conda package out, too.

@xiechenhao
Copy link

The template_path problems should be fixed now in the jupyter-nbextensions-configurator. There is a PyPi release for this. We are still trying to get a new conda package out, too.

I have installed the latest version,but still can not fix the problem.

@juhasch
Copy link
Member

juhasch commented Dec 21, 2022

The issue should be fixed from our side. Please check if you still have jupyter-latex-envs installed or provide more information.

@demotu
Copy link
Contributor Author

demotu commented Dec 21, 2022

I can confirm it works with the latest version (jupyter-contrib-nbextensions 0.7.0 via pip).
I did the following as suggested:
conda uninstall jupyter_latex_envs
pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
jupyter contrib nbextension install --sys-prefix
No more messages related to template_path and both html and pdf (via LaTeX) outputs work.

Thanks.

@stefansimik
Copy link

Does also export as html_toc work for you?

I tested, and it worked - i.e. output HTML file was generated without any errors in console, but the final content of the file was partially wrong - because the main point - the TOC was completely missing and at its place text None was displayed in HTML file. But maybe, this does not relate closely with this issue 👍

@demotu
Copy link
Contributor Author

demotu commented Dec 22, 2022

Yes, it shows the TOC correctly when using the menu option Download as for both HTML + TOC and PDF via LaTeX.
However, in the html file it also shows None at the top (in the pdf file it doesn't).

@stefansimik
Copy link

Thanks for confirmation.
I would like to report issue, that html_toc type of export does not work correctly.
Where could I report it please?
(I have no idea, which specific library is responsible for this specific issue)

@juhasch
Copy link
Member

juhasch commented Dec 22, 2022

This is the right repo to report this issue. Unfortunately, the original author is no longer active, so fixing things takes time.

The Jupyter configuration system is not so easy to understand, but basically the html_toc option uses the toc2.tpl template to export a html with toc. This template is outdated and links to resources that are no longer online.

An attempted fix can be found in PR #1622.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants