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

Config option template_path not recognized by LenvsLatexExporter. Did you mean one of: template_file, template_name, template_paths? #1529

Open
ivarzap opened this issue Sep 17, 2020 · 80 comments

Comments

@ivarzap
Copy link

ivarzap commented Sep 17, 2020

Several warning messages like the present are shown whenever I open any notebook from jupyter.
I have disabled jupyter_contrib_nbextensions and then uninstalled them.

In all cases, warnings are shown, like in:

[W 18:49:22.283 NotebookApp] Config option template_path not recognized by LenvsHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.293 NotebookApp] Config option template_path not recognized by LenvsHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.314 NotebookApp] Config option template_path not recognized by LenvsTocHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.324 NotebookApp] Config option template_path not recognized by LenvsTocHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.366 NotebookApp] Config option template_path not recognized by LenvsLatexExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.371 NotebookApp] Config option template_path not recognized by LenvsLatexExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.555 NotebookApp] Config option template_path not recognized by LenvsSlidesExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.562 NotebookApp] Config option template_path not recognized by LenvsSlidesExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.663 NotebookApp] Config option template_path not recognized by LenvsHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.673 NotebookApp] Config option template_path not recognized by LenvsHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.694 NotebookApp] Config option template_path not recognized by LenvsTocHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.704 NotebookApp] Config option template_path not recognized by LenvsTocHTMLExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.746 NotebookApp] Config option template_path not recognized by LenvsLatexExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.752 NotebookApp] Config option template_path not recognized by LenvsLatexExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.911 NotebookApp] Config option template_path not recognized by LenvsSlidesExporter. Did you mean one of: template_file, template_name, template_paths?
[W 18:49:22.917 NotebookApp] Config option template_path not recognized by LenvsSlidesExporter. Did you mean one of: template_file, template_name, template_paths?

@ivarzap
Copy link
Author

ivarzap commented Sep 18, 2020

I forgot to mention that even after disabling and/or uninstalling, the warnings continue to show.

@stefansimik
Copy link

stefansimik commented Sep 18, 2020

I have the exactly same problem.

While looking for possible causes, I found one thing:

  • when I downgraded from nbconvert 6.0.3 to 5.6.1, issues are gone - warning are gone and exports started working again
    • use conda install "nbconvert=5.6.1"
  • this probably means, that nbconvert >= 6.00 has significant changes - see here: https://nbconvert.readthedocs.io/en/latest/changelog.html#significant-changes
    • one specially interesting is: template_path has become template_paths - maybe this can be related with the issue

@stefansimik
Copy link

I forgot to mention that even after disabling and/or uninstalling, the warnings continue to show.

One more thing to add, that exports from menu File -> Export Notebook As... are also failing.

@garynth41
Copy link

I forgot to mention that even after disabling and/or uninstalling, the warnings continue to show.

One more thing to add, that exports from menu File -> Export Notebook As... are also failing.

I have the same issue. After several days to working the annoying problem, deleting and reinstalling, they wont go away. I found this thread when I wanted to open a new issue, so thanks guys for the work around.

@xguse
Copy link

xguse commented Sep 22, 2020

Edit: it looks like @stefansimik already said this

I just figured this out.

It has to do with the fact that nbconvert 6.0 changed template_path to template_paths. Until this project changes that you should require nbconvert<6.

This fixed it for me.

@stefansimik
Copy link

I am not sure, where change should happen / what project should be updated...

  • if nbconvert should rollback its changes
  • or other projects depending on nbconvert should update and get in sync with nbconvert

@neurologic
Copy link

neurologic commented Sep 28, 2020

I had the same error and downgrading nbconvert to 5.6.1 helped prevent these errors when running jupyter notebook.
HOWEVER, I am still having trouble with nbextensions. When I open a notebook that previously used to successfully have a table of contents, I am now getting an error:
404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200928130405 (::1) 8.80ms referer=http://localhost:8889/notebooks/Figures.ipynb
(Figures.ipynb is the notebook I am trying to run).
And there is no longer a table of contents tab/option in the notebook (though the collapsible headings seem to be working).

I have searched around for a while now and still no success. Any ideas/help?

Thanks!

UPDATE: the table of contents does show up for a different notebook.
The notebook that it is not showing up in has been the one that I have been mainly using TOC (successfully) in until today.

@stefansimik
Copy link

stefansimik commented Sep 28, 2020

I had the same error and downgrading nbconvert to 5.6.1 helped prevent these errors when running jupyter notebook.
HOWEVER, I am still having trouble with nbextensions. When I open a notebook that previously used to successfully have a table of contents, I am now getting an error:
404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200928130405 (::1) 8.80ms referer=http://localhost:8889/notebooks/Figures.ipynb
(Figures.ipynb is the notebook I am trying to run).
And there is no longer a table of contents tab/option in the notebook (though the collapsible headings seem to be working).

I have searched around for a while now and still no success. Any ideas/help?

Thanks!

UPDATE: the table of contents does show up for a different notebook.
The notebook that it is not showing up in has been the one that I have been mainly using TOC (successfully) in until today.

Just in my case - I can say, that TOC extension (https://github.com/jupyterlab/jupyterlab-toc) was working correctly all the time, i.e. even before downgrading nbconvert back to v5.6.1
That's why I am not sure, if problem in TOC is directly related to bad version of nbconvert ...

@demotu
Copy link
Contributor

demotu commented Sep 29, 2020

Yes, this issue is related to the change in Nbconvert that replaced 'template_path' with 'template_paths'.

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

I opened pull requests with these changes:
jfbercher/jupyter_latex_envs#58
#1532

If you want to get rid of the error messages before the extensions update, install the extensions from my repos (or clone them) or just replace 'template_path' with 'template_paths' in the local folders of these extensions (in my case these extensions were in ~/miniconda3/lib/python3.8/site-packages/...)

@albolea
Copy link

albolea commented Oct 19, 2020

Yes, this issue is related to the change in Nbconvert that replaced 'template_path' with 'template_paths'.

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

I opened pull requests with these changes:
jfbercher/jupyter_latex_envs#58
#1532

If you want to get rid of the error messages before the extensions update, install the extensions from my repos (or clone them) or just replace 'template_path' with 'template_paths' in the local folders of these extensions (in my case these extensions were in ~/miniconda3/lib/python3.8/site-packages/...)

How can I do the replace??

@demotu
Copy link
Contributor

demotu commented Oct 20, 2020

Yes, this issue is related to the change in Nbconvert that replaced 'template_path' with 'template_paths'.
Replacing all instances of 'template_path' with 'template_paths' in the extensions jupyter_latex_envs and jupyter_contrib_nbextensions fixes the error.
I opened pull requests with these changes:
jfbercher/jupyter_latex_envs#58
#1532
If you want to get rid of the error messages before the extensions update, install the extensions from my repos (or clone them) or just replace 'template_path' with 'template_paths' in the local folders of these extensions (in my case these extensions were in ~/miniconda3/lib/python3.8/site-packages/...)

How can I do the replace??

If you want to manually replace all instances of 'template_path' in the files, you can use an editor such as Visual Studio Code or PyCharm. For example, in VS Code:

  1. Use the menu option 'File/Open Folder...' to select the desired folder ('jupyter_contrib_nbextensions', 'jupyter_latex_envs' or 'latex_envs').
  2. Use the menu option 'Edit/Replace in Files' and type 'template_path' and 'template_paths' in the text boxes (without quotes) to replace all occurrences.

@outsider-duwen
Copy link

I have encountered the same problem. Has anyone solved it now?

@squeezer44
Copy link

Yes, this issue is related to the change in Nbconvert that replaced 'template_path' with 'template_paths'.

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

I opened pull requests with these changes:
jfbercher/jupyter_latex_envs#58
#1532

If you want to get rid of the error messages before the extensions update, install the extensions from my repos (or clone them) or just replace 'template_path' with 'template_paths' in the local folders of these extensions (in my case these extensions were in ~/miniconda3/lib/python3.8/site-packages/...)

Hopefully this pull request can be merged soon - I do have the same problem.

@outsider-duwen
Copy link

我有完全一样的问题。

在寻找可能的原因时,我发现了一件事:

  • 当我从nbconvert 6.0.3降级到5.6.1时,问题消失了-警告消失了,导出又开始工作了

    • conda install "nbconvert=5.6.1"
  • 这可能意味着nbconvert> = 6.00发生了重大变化-参见此处:https ://nbconvert.readthedocs.io/en/latest/changelog.html#significant-changes

    • 一个特别有趣的是:template_path has become template_paths-也许这可能与问题有关

Hello, I did not solve my problem according to your operation. Is there any other way?

@outsider-duwen
Copy link

是的,此问题与Nbconvert中将“ template_paths”替换为“ template_paths”的更改有关。
将扩展名jupyter_latex_envs和jupyter_contrib_nbextensions中的'template_paths'替换为'template_paths'的所有实例可修复该错误。
我通过以下更改打开了请求请求:
jfbercher / jupyter_latex_envs#58
#1532
如果要在扩展程序更新之前消除错误消息,请从我的存储库中安装扩展程序(或克隆它们),或者在这些扩展程序的本地文件夹中将“ template_paths”替换为“ template_paths”(在我的情况下,这些扩展名是在〜/ miniconda3 / lib / python3.8 / site-packages / ...)

希望这个拉取请求可以很快合并-我确实有同样的问题。

I solved this problem.First, run pip uninstall nbconvert in Anaconda prompt, and then run conda install "nbconvert = 5.6.1" to solve this problem perfectly!

@squeezer44
Copy link

I solved this problem.First, run pip uninstall nbconvert in Anaconda prompt, and then run conda install "nbconvert = 5.6.1" to solve this problem perfectly!

@outsider-duwen you've downgraded your local version of nbconvert back to 5.6.1.
But is this really the only option to solve that?

If I understood it correct a fix is waiting to be deployed:
I opened pull requests with these changes:
jfbercher/jupyter_latex_envs#58
#1532

@outsider-duwen
Copy link

I solved this problem.First, run pip uninstall nbconvert in Anaconda prompt, and then run conda install "nbconvert = 5.6.1" to solve this problem perfectly!

@outsider-duwen you've downgraded your local version of nbconvert back to 5.6.1.
But is this really the only option to solve that?

If I understood it correct a fix is waiting to be deployed:
I opened pull requests with these changes:
jfbercher/jupyter_latex_envs#58
#1532

I don't think this is the only solution. I hope you can solve it perfectly. After this bug is fixed, I will try other methods.

@stefansimik
Copy link

stefansimik commented Oct 25, 2020

Current status of this issue - 2020-10-26

We are waiting for changes in CI configuration:

@GF-Huang
Copy link

GF-Huang commented Nov 9, 2020

So how to solve this issue?

@stefansimik
Copy link

So how to solve this issue?

conda install "nbconvert=5.6.1"

@reece
Copy link

reece commented Nov 13, 2020

Yep, or pip install "nbconvert<6"

@RenaultAI
Copy link

Because I wasn't using the jupyter-latex-envs extension anyway, I ran pip uninstall jupyter-latex-envs to remove those warnings.

pip uninstall jupyter-latex-envs
Found existing installation: jupyter-latex-envs 1.4.6
Uninstalling jupyter-latex-envs-1.4.6:
  Would remove:
    /home/ryoung/anaconda3/lib/python3.7/site-packages/jupyter_latex_envs-1.4.6.dist-info/*
    /home/ryoung/anaconda3/lib/python3.7/site-packages/latex_envs/*
Proceed (y/n)? y
  Successfully uninstalled jupyter-latex-envs-1.4.6

@Paradoxdruid
Copy link

I found the easiest solution for now was to run:

jupyter notebook --log-level=40

which suppresses warnings, for good or ill.

@stefansimik
Copy link

stefansimik commented Oct 19, 2022

Downgrading worked for me: conda install -c conda-forge nbconvert==5.6.1

Yes, the command itself can run successfully, but with many negative effects:

  • global downgrading of many libraries, which is not acceptable for man projects with fixed dependencies
  • many functionalities after deeper testing do not work - see comments above: 'export to html_toc format doesn't work properly'

@cerdemo
Copy link

cerdemo commented Oct 19, 2022

Downgrading worked for me: conda install -c conda-forge nbconvert==5.6.1

Yes, the command itself can run successfully, but with many negative effects:

  • global downgrading of many libraries, which is not acceptable for man projects with fixed dependencies
  • many functionalities after deeper testing do not work - see comments above: 'export to html_toc format doesn't work properly'

Yes, I saw that. I work on it within an env and test for now how things work in practice. I will post updates when I experience some particular troubles. Thanks!

@illtellyoulater
Copy link

illtellyoulater commented Dec 7, 2022

In my case the packages that got downgraded after I downgraded nbconvert are:

  jinja2             pkgs/main/win-64::jinja2-3.1.2-py39ha~ --> conda-forge/noarch::jinja2-2.11.3-pyhd8ed1ab_2
  jupyter_server     pkgs/main/win-64::jupyter_server-1.18~ --> conda-forge/noarch::jupyter_server-1.13.5-pyhd8ed1ab_0
  markupsafe         pkgs/main::markupsafe-2.1.1-py39h2bbf~ --> conda-forge::markupsafe-2.0.1-py39hb82d6ee_1
  nbconvert          pkgs/main/win-64::nbconvert-6.5.4-py3~ --> conda-forge/noarch::nbconvert-5.6.1-pyhd8ed1ab_2
  notebook           pkgs/main/win-64::notebook-6.5.2-py39~ --> conda-forge/noarch::notebook-6.4.12-pyha770c72_0

So not a big deal I guess, but how long do we still have to wait for this to get properly fixed?
Also, where exactly should we report the problems involving template_path and export to html_toc to help expedite their resolution?

UPDATE: I talked too soon! Apparently downgrading nbconvert didn't fix it completely! I'm still seeing the following errors:

[W 14:19:26.447 NotebookApp] Config option `extra_template_paths` not recognized by `ExporterCollapsibleHeadings`.  Did you mean `template_path`?
[W 14:19:26.479 NotebookApp] Config option `extra_template_paths` not recognized by `TocExporter`.  Did you mean `template_path`?
[I 14:19:29.312 NotebookApp] Kernel started: 1eb06ccc-03a9-4659-b53b-2c6adad119dc, name: python3
[IPKernelApp] ERROR | No such comm target registered: jupyter.widget.control
[IPKernelApp] WARNING | No such comm: bbdc794c-6618-4c94-9997-a8b02b94b982

The only difference is I'm just seeing a single occurrence of that and not multiple errors as OP reported.
What should I do?

(Note for myself: I encountered this problem while trying to install Disco Diffusion)

@stefansimik
Copy link

@illtellyoulater
You summarized it very nicely, I am locked in exactly the same problem
and I would really welcome anyone, who could bring some more light, how to solve this finally.

@juhasch
Copy link
Member

juhasch commented Dec 7, 2022

There is a new release that should solve the problems on PyPi. Unfortunately, the maintainer of the conda-forge packages is no longer active. We are trying to fix this, so the update will be available through conda, too.

@ggrrll
Copy link

ggrrll commented Jan 26, 2023

in my case, installing "nbconvert<6" gives 500 error when I try to open a notebook -- now I am back to v. nbconvert-7.2.9

@stefansimik
Copy link

stefansimik commented Jan 26, 2023

in my case, installing "nbconvert<6" gives 500 error when I try to open a notebook -- now I am back to v. nbconvert-7.2.9

Exactly, I have to confirm the same problem.

01_JupyterLab_Save_and_Export_Notebook_as_Html_toc

02_ErrorMessage_500_nbconvert_toc2 tpl_failed

03_ErrorMessage_AnacondaPrompt_nbconvert_toc2 tpl_failed

Exporting as HTML_TOC is simply still not working as one piece of functional software.
People in Jupyter community somehow cannot fix this for almost 2 years.

@kimin0402
Copy link

It seems like the problem persists in nbconvert==7.2.9 and jupyter-notebook==6.5.2.
Downgrading to nbconvert==5.6.1 is not a suitable solution anymore as the version 5.6.1 was last updated in 2019.
(unless you are comfortable with living in 2019 with many outdated dependencies)
I'm quite surprised to see how such a simple error could persist for more than 4 years.

@stefansimik
Copy link

It seems like the problem persists in nbconvert==7.2.9 and jupyter-notebook==6.5.2. Downgrading to nbconvert==5.6.1 is not a suitable solution anymore as the version 5.6.1 was last updated in 2019. (unless you are comfortable with living in 2019 with many outdated dependencies) I'm quite surprised to see how such a simple error could persist for more than 4

Excellently summed and explained 👍
Sadly, I have to confirm each word.

@juhasch
Copy link
Member

juhasch commented Feb 6, 2023

So it looks like you have got a stale config file for nbconvert.
Try this:
jupyter nbconvert --show-config

This will show you the used configuration file and the configuration. Either edit it to remove the offending stuff or delete it.

@kimin0402
Copy link

So it looks like you have got a stale config file for nbconvert. Try this: jupyter nbconvert --show-config

This will show you the used configuration file and the configuration. Either edit it to remove the offending stuff or delete it.

Hi juhasch, thank you for your quick reply.
This is the content of my nbconvert_config.json (what i get when I type jupyter nbconvert --show-config)
Am I missing something here?

Loaded config files:
  [Path_to_my_env]/etc/jupyter/jupyter_nbconvert_config.json

Exporter
  .extra_template_paths = [   '.',
    '[Path_to_my_env]/lib/python3.10/site-packages/jupyter_contrib_nbextensions/templates']
  .preprocessors = [   'jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor',
    'jupyter_contrib_nbextensions.nbconvert_support.PyMarkdownPreprocessor']

@juhasch
Copy link
Member

juhasch commented Feb 9, 2023

This configuration adds support for the notebook extensions to nbconvert. If you don't need it, simply remove the config file, or at least all entries that contain nbextensions.

@kimin0402
Copy link

This configuration adds support for the notebook extensions to nbconvert. If you don't need it, simply remove the config file, or at least all entries that contain nbextensions.

Even after deleting jupyter_nbconvert_config.json file, the problem persists.

@whacked
Copy link

whacked commented Mar 2, 2023

I landed here after encountering a bunch of template_path errors, the first of which is

Config option `template_path` not recognized by `ExporterCollapsibleHeadings`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?

my jupyter environment versions:

$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.11.0
ipykernel        : 6.21.2
ipywidgets       : not installed
jupyter_client   : 8.0.3
jupyter_core     : 5.2.0
jupyter_server   : 2.0.0
jupyterlab       : not installed
nbclient         : 0.7.2
nbconvert        : 7.2.9
nbformat         : 5.7.3
notebook         : 6.2.0
qtconsole        : not installed
traitlets        : 5.9.0

My objective is to run jupyter notebook with nbextensions, TOC2 in particular. I encountered a bunch of weird version incompatibilities leading to 500 server errors or the table of contents showing up blank. As of the versions shown above, my TOC2 setup appears to be working, even though I get 20+ lines of template_path warnings when I open my notebooks. With the caveat that I don't use any of the export functions and haven't tried any, here's a script I used to get rid of the warnings:

#!/usr/bin/env bash

DRY_RUN=0  # change to 1 to just print the changes
SITE_PACKAGES_DIR=$(python -c 'import site; print(site.getsitepackages()[0])')

patch-template-paths-with-backup() {
    _target_relpath=$1
    _target_file=$SITE_PACKAGES_DIR/$_target_relpath
    _backup_file=$_target_file.orig
    if [ -e $_backup_file ]; then
        echo "WARN: $_backup_file exists; assuming patch is already completed"
        return
    fi

    SED_STRING='s/\btemplate_path\b/template_paths/g'

    if [ $DRY_RUN -eq 1 ]; then
        cat $_target_file |
            sed $SED_STRING |
            diff -Naur $_target_file -
        read
    else
        set -x
        mv $_target_file $_backup_file
        set +x
        cat $_backup_file |
            sed $SED_STRING |
            cat > $_target_file
    fi
}

FILES_TO_CONVERT=(
    jupyter_contrib_nbextensions/config_scripts/highlight_html_cfg.py
    jupyter_contrib_nbextensions/config_scripts/highlight_latex_cfg.py
    jupyter_contrib_nbextensions/install.py
    jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py
    jupyter_contrib_nbextensions/nbconvert_support/toc2.py
    jupyter_contrib_nbextensions/nbextensions/runtools/readme.md
    jupyter_core/tests/dotipython_empty/profile_default/ipython_nbconvert_config.py
    latex_envs/latex_envs.py
);

for file_to_convert in ${FILES_TO_CONVERT[@]}; do
    echo $file_to_convert
    patch-template-paths-with-backup $file_to_convert
done

save this to a bash script in the venv and run it. Restart the server, and the template_path warnings disappear. Maybe we're sweeping something under the rug. Don't know, but the terminal output is cleaner for now. Use at your own risk.

@JupyterJones
Copy link

Notice the date ......... This problem still exists
[W 04:27:59.481 NotebookApp] Config option template_path not recognized by LenvsLatexExporter. Did you mean one of: extra_template_paths, template_name, template_paths?

@hugohashi
Copy link

Has anyone found a workaround for this issue?

@stefansimik
Copy link

Has anyone found a workaround for this issue?

No, it is still a problem 🙏

@pertetotale
Copy link

Im having this for years.
remembering some errors, could it be an issue about the config files being upgraded to some new notebook version, hence template version, (later also jup lab)
and so from that point the modified "app" and "server" links are messed up,
like from that "NotebookApp" to "NotebookServer" turnover, or was it visa versa,
or the obsoletes cause this error waterfall.
Just dropping in an idea. Maybe someone sees a light.

allen-ball added a commit to allen-ball/ganymede-notebooks that referenced this issue Jun 14, 2023
@palbarede
Copy link

palbarede commented Jul 9, 2023

I don't see the problem in Jupyter delivered with anaconda (in a virtual environment specially created to check this). Somehow, ananconda has solved the problem and their solution is implicit in anaconda package version numbers. In particuler, nbconvert is 6.5.4.

@stefansimik
Copy link

stefansimik commented Jul 9, 2023

I don't see the problem in Jupyter delivered with anaconda (in a virtual environment specially created to check this). Somehow, ananconda has solved the problem and their solution is implicit in anaconda package version numbers. In particuler, nbconvert is 6.5.4.

@palbarede
You should be more specific about exact versions (Anaconda, Python installed, libraries), otherwise nobody really knows, what you have installed.

conda --version
conda env export

@gaowqspace
Copy link

Today, I met the same questions.

@chang48
Copy link

chang48 commented Aug 17, 2023

Today, I met the same questions.

I stumbled on the same issue today. It's 2023 so reverting nbconvert back to pre 6.0 version is probably not the optimal option. Instead, I tried the following:

  1. Locate the file templateexporter.py in your python env. For me, it is under miniforge3/envs/nlp/lib/python3.9/site-packages/nbconvert You should replace my nlp with your venv name.
  2. Find the following lines:before
  3. Define extra variables template_path, extra_template_path, and extra_template_basedir as the following:after

After adding these extra definitions, the Config option template_path.... does not show up anymore. So it seems to work. This is just a workaround. Hopefully someone could come up with a fix to this problem.

@pxpwoa
Copy link

pxpwoa commented Sep 13, 2023

upgrade nbconvert to 7.6.0 version solves my problem.

@chang48
Copy link

chang48 commented Oct 7, 2023

upgrade nbconvert to 7.6.0 version solves my problem.
Unfortunately for me the problem persists with nbconvert=7.6.0. So I went back to my hackish solution...

@mherrmann3
Copy link

Modifying nbconvert/exporters/templateexporter.py as suggested by @chang48 has the unfortunate side effect that some of nbconvert's TemplateExporters like HTMLExporter cannot find the templates such as lab or classic anymore, resulting in the following error (e.g., when doing nbconvert.HTMLExporter().from_notebook_node(nb, resources)):

jinja2.exceptions.TemplateNotFound: index.html.j2

The cleanest solution seems therefore to only modify latex_envs/latex_envs.py by replacing template_path with template_paths, as this outdated package1 seems to be the culprit, as noted by several commenters above.

Footnotes

  1. Note that it's outdated on conda-forge. The original repository replaced template_path with template_paths already in Sept. 2020. Hence, you could as well just replace your latex_envs.py with the upstream latex_envs.py.

@ziyuang
Copy link

ziyuang commented Oct 4, 2024

Hence, you could as well just replace your latex_envs.py with the upstream latex_envs.py.

You may want to replace some \ with \\ in that file as well.

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

No branches or pull requests