ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.2k stars 806 forks source link

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

Open ivarzap opened 3 years ago

ivarzap commented 3 years ago

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 commented 3 years ago

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

stefansimik commented 3 years ago

I have the exactly same problem.

While looking for possible causes, I found one thing:

stefansimik commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

neurologic commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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: https://github.com/jfbercher/jupyter_latex_envs/pull/58 https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

squeezer44 commented 3 years ago

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 commented 3 years ago

我有完全一样的问题。

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

  • 当我从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 commented 3 years ago

是的,此问题与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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Current status of this issue - 2020-10-26

We are waiting for changes in CI configuration:

GF-Huang commented 3 years ago

So how to solve this issue?

stefansimik commented 3 years ago

So how to solve this issue?

conda install "nbconvert=5.6.1"

reece commented 3 years ago

Yep, or pip install "nbconvert<6"

RenaultAI commented 3 years ago

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 commented 3 years ago

I found the easiest solution for now was to run:

jupyter notebook --log-level=40

which suppresses warnings, for good or ill.

richlysakowski commented 3 years ago

The solution conda install "nbconvert=5.6.1" worked for me. The 404 errors about "template_path" not recognized went away.

I see several suggestions here to use PIP to solve this problem. Unless you used PIP manually to install nbconvert yourself, then don't uninstall it with PIP; do it with conda or you may corrupt your conda user environment.

I want to caution new Python programmers to NOT use mix pip and conda command line instructions to install and uninstall packages in your base environment, unless you REALLY know what you are doing. You can royally mess up for Anaconda installation to the point where you will be chasing your tail until you completely uninstall and reinstall the entire Anaconda distribution. Always use conda to uninstall packages that were installed with conda ! Pip is not "conda friendly" because it does not reliably update the conda package index.

UPDATE FROM LAST POST ABOUT THIS:

I had the same problem in another conda environment. Using the conda install "nbconvert=5.6.1" was not working; it took forever and never finished. I did a pip uninstall nbconvert in the conda environment. Then I did a conda update --all and that actually installed nbconvert=5.1.3, which is what I needed. So once again conda's integrity-checking algorithm repaired an environment that pip messed up. Very nice.

4/14/2021 UPDATE: Today with a new conda environment running Python 3.9, the nbconvert=5.6.1 downgrade solution refused to work:

# conda install "nbconvert=5.6.1"
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - nbconvert=5.6.1 -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.6,<3.7.0a0']

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

So now I will try the manual hacks that other people in this thread have suggested.

But my question is why does NBconvert need a version of Python < 3.9 ??

- nbconvert=5.6.1 -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.6,<3.7.0a0']

What "breaking changes" occured in Python 3.9 to make Nbconvert kick up these config option messages in Jupyter ServerApp?

fjdu commented 3 years ago

My solution, which seems to work in my computer, is like this:

Replace template_path with template_paths in the following files:

xxx/anaconda3/lib/python3.x/site-packages/latex_envs/latex_envs.py xxx/anaconda3/lib/python3.x/site-packages/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py xxx/anaconda3/lib/python3.x/site-packages/jupyter_contrib_nbextensions/nbconvert_support/toc2.py

richlysakowski commented 3 years ago

I applied the changes that @fjdu suggested but now have a new set of tracebacks and errors showing in the command terminal where I start up a new conda environment called "jlab" running on Jupyter Server 1.5.1 on Windows 10.


# jupyter lab
C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_server\transutils.py:13: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
  warnings.warn(warn_msg, FutureWarning)
[I 2021-04-14 00:25:30.587 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-04-14 00:25:30.588 ServerApp] jupyterlab_snippets | extension was successfully linked.
[W 2021-04-14 00:25:30.722 NotebookApp] 'browser' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-04-14 00:25:30.736 ServerApp] The 'min_open_files_limit' trait of a ServerApp instance expected an int, not the NoneType None.
[I 2021-04-14 00:25:30.762 LabApp] JupyterLab extension loaded from C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyterlab
[I 2021-04-14 00:25:30.762 LabApp] JupyterLab application directory is C:\ProgramData\Anaconda3\envs\jlab\share\jupyter\lab
[I 2021-04-14 00:25:30.765 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-04-14 00:25:30.766 ServerApp] jupyterlab_snippets | extension was successfully loaded.
[I 2021-04-14 00:25:31.104 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-04-14 00:25:31.316 ServerApp] Serving notebooks from local directory: C:\Users\richadmin
[I 2021-04-14 00:25:31.317 ServerApp] Jupyter Server 1.5.1 is running at:
[I 2021-04-14 00:25:31.317 ServerApp] http://localhost:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
[I 2021-04-14 00:25:31.318 ServerApp]  or http://127.0.0.1:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
[I 2021-04-14 00:25:31.318 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2021-04-14 00:25:31.329 ServerApp]

    To access the server, open this file in a browser:
        file:///C:/Users/richadmin/AppData/Roaming/jupyter/runtime/jpserver-21148-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
     or http://127.0.0.1:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
[I 2021-04-14 00:25:35.522 LabApp] Build is up to date
[E 2021-04-14 00:25:35.807 ServerApp] Uncaught exception GET /api/nbconvert?1618374334927 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/nbconvert?1618374334927', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 1702, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 3173, in wrapper
        return method(self, *args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_server\services\nbconvert\handlers.py", line 17, in get
        exporters = base.get_export_names()
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 141, in get_export_names
        e = get_exporter(exporter_name)(config=config)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 102, in get_exporter
        if getattr(exporter(config=config), 'enabled', True):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\collapsible_headings.py", line 26, in __init__
        super(ExporterCollapsibleHeadings, self).__init__(*args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\templateexporter.py", line 325, in __init__
        super().__init__(config=config, **kw)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\exporter.py", line 108, in __init__
        with_default_config = self.default_config
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\exporter_inliner.py", line 43, in default_config
        if contrib_templates_dir not in template_path:
    NameError: name 'template_path' is not defined
[W 2021-04-14 00:25:35.816 ServerApp] Unhandled error
[E 2021-04-14 00:25:35.817 ServerApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0",
      "Accept": "*/*",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "Referer": "http://localhost:8888/lab",
      "Authorization": "token 3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf",
      "X-Xsrftoken": "2|66b403bc|7585b3df62211686fd09f319d8d2136e|1617656094",
      "Content-Type": "application/json",
      "Connection": "keep-alive",
      "Cookie": "username-localhost-8890=\"2|1:0|10:1617759437|23:username-localhost-8890|44:M2VmZjk5NTNlMWI1NDhlZGI5YTA2ZDM4OTJkOGJlN2M=  <<< cookies cut out>>> "",
      "Pragma": "no-cache",
      "Cache-Control": "no-cache"
    }
[E 2021-04-14 00:25:35.820 ServerApp] 500 GET /api/nbconvert?1618374334927 (127.0.0.1) 285.90ms referer=http://localhost:8888/lab
[E 2021-04-14 00:25:35.935 ServerApp] Uncaught exception GET /api/nbconvert?1618374334947 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/nbconvert?1618374334947', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 1702, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 3173, in wrapper
        return method(self, *args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_server\services\nbconvert\handlers.py", line 17, in get
        exporters = base.get_export_names()
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 141, in get_export_names
        e = get_exporter(exporter_name)(config=config)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 102, in get_exporter
        if getattr(exporter(config=config), 'enabled', True):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\collapsible_headings.py", line 26, in __init__
        super(ExporterCollapsibleHeadings, self).__init__(*args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\templateexporter.py", line 325, in __init__
        super().__init__(config=config, **kw)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\exporter.py", line 108, in __init__
        with_default_config = self.default_config
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\exporter_inliner.py", line 43, in default_config
        if contrib_templates_dir not in template_path:
    NameError: name 'template_path' is not defined
[W 2021-04-14 00:25:35.939 ServerApp] Unhandled error
[E 2021-04-14 00:25:35.940 ServerApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0",
      "Accept": "*/*",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "Referer": "http://localhost:8888/lab",
      "Authorization": "token 3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf",
      "X-Xsrftoken": "2|66b403bc|7585b3df62211686fd09f319d8d2136e|1617656094",
      "Content-Type": "application/json",
      "Connection": "keep-alive",
      "Cookie": "username-localhost-8890=\"2|1:0|10:1617759437|23:username-localhost-8890|44:M2VmZjk5NTNlMWI1NDhlZGI5YTA2ZDM4OTJkOGJlN2M=<<<COOKIES CUT OUT>>>\"",
      "Pragma": "no-cache",
      "Cache-Control": "no-cache"
    }
[E 2021-04-14 00:25:35.943 ServerApp] 500 GET /api/nbconvert?1618374334947 (127.0.0.1) 409.91ms referer=http://localhost:8888/lab
fjdu commented 3 years ago

I applied the changes that @fjdu suggested but now have a new set of tracebacks and errors showing in the command terminal where I start up a new conda environment called "jlab" running on Jupyter Server 1.5.1 on Windows 10.

# jupyter lab
C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_server\transutils.py:13: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
  warnings.warn(warn_msg, FutureWarning)
[I 2021-04-14 00:25:30.587 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-04-14 00:25:30.588 ServerApp] jupyterlab_snippets | extension was successfully linked.
[W 2021-04-14 00:25:30.722 NotebookApp] 'browser' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-04-14 00:25:30.736 ServerApp] The 'min_open_files_limit' trait of a ServerApp instance expected an int, not the NoneType None.
[I 2021-04-14 00:25:30.762 LabApp] JupyterLab extension loaded from C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyterlab
[I 2021-04-14 00:25:30.762 LabApp] JupyterLab application directory is C:\ProgramData\Anaconda3\envs\jlab\share\jupyter\lab
[I 2021-04-14 00:25:30.765 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-04-14 00:25:30.766 ServerApp] jupyterlab_snippets | extension was successfully loaded.
[I 2021-04-14 00:25:31.104 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-04-14 00:25:31.316 ServerApp] Serving notebooks from local directory: C:\Users\richadmin
[I 2021-04-14 00:25:31.317 ServerApp] Jupyter Server 1.5.1 is running at:
[I 2021-04-14 00:25:31.317 ServerApp] http://localhost:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
[I 2021-04-14 00:25:31.318 ServerApp]  or http://127.0.0.1:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
[I 2021-04-14 00:25:31.318 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2021-04-14 00:25:31.329 ServerApp]

    To access the server, open this file in a browser:
        file:///C:/Users/richadmin/AppData/Roaming/jupyter/runtime/jpserver-21148-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
     or http://127.0.0.1:8888/lab?token=3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf
[I 2021-04-14 00:25:35.522 LabApp] Build is up to date
[E 2021-04-14 00:25:35.807 ServerApp] Uncaught exception GET /api/nbconvert?1618374334927 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/nbconvert?1618374334927', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 1702, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 3173, in wrapper
        return method(self, *args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_server\services\nbconvert\handlers.py", line 17, in get
        exporters = base.get_export_names()
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 141, in get_export_names
        e = get_exporter(exporter_name)(config=config)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 102, in get_exporter
        if getattr(exporter(config=config), 'enabled', True):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\collapsible_headings.py", line 26, in __init__
        super(ExporterCollapsibleHeadings, self).__init__(*args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\templateexporter.py", line 325, in __init__
        super().__init__(config=config, **kw)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\exporter.py", line 108, in __init__
        with_default_config = self.default_config
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\exporter_inliner.py", line 43, in default_config
        if contrib_templates_dir not in template_path:
    NameError: name 'template_path' is not defined
[W 2021-04-14 00:25:35.816 ServerApp] Unhandled error
[E 2021-04-14 00:25:35.817 ServerApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0",
      "Accept": "*/*",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "Referer": "http://localhost:8888/lab",
      "Authorization": "token 3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf",
      "X-Xsrftoken": "2|66b403bc|7585b3df62211686fd09f319d8d2136e|1617656094",
      "Content-Type": "application/json",
      "Connection": "keep-alive",
      "Cookie": "username-localhost-8890=\"2|1:0|10:1617759437|23:username-localhost-8890|44:M2VmZjk5NTNlMWI1NDhlZGI5YTA2ZDM4OTJkOGJlN2M=  <<< cookies cut out>>> "",
      "Pragma": "no-cache",
      "Cache-Control": "no-cache"
    }
[E 2021-04-14 00:25:35.820 ServerApp] 500 GET /api/nbconvert?1618374334927 (127.0.0.1) 285.90ms referer=http://localhost:8888/lab
[E 2021-04-14 00:25:35.935 ServerApp] Uncaught exception GET /api/nbconvert?1618374334947 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/nbconvert?1618374334947', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 1702, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\tornado\web.py", line 3173, in wrapper
        return method(self, *args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_server\services\nbconvert\handlers.py", line 17, in get
        exporters = base.get_export_names()
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 141, in get_export_names
        e = get_exporter(exporter_name)(config=config)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\base.py", line 102, in get_exporter
        if getattr(exporter(config=config), 'enabled', True):
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\collapsible_headings.py", line 26, in __init__
        super(ExporterCollapsibleHeadings, self).__init__(*args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\templateexporter.py", line 325, in __init__
        super().__init__(config=config, **kw)
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\nbconvert\exporters\exporter.py", line 108, in __init__
        with_default_config = self.default_config
      File "C:\ProgramData\Anaconda3\envs\jlab\lib\site-packages\jupyter_contrib_nbextensions\nbconvert_support\exporter_inliner.py", line 43, in default_config
        if contrib_templates_dir not in template_path:
    NameError: name 'template_path' is not defined
[W 2021-04-14 00:25:35.939 ServerApp] Unhandled error
[E 2021-04-14 00:25:35.940 ServerApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0",
      "Accept": "*/*",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "Referer": "http://localhost:8888/lab",
      "Authorization": "token 3a453c2718431429b3612a0561034cae4b3bc355bdf8e1cf",
      "X-Xsrftoken": "2|66b403bc|7585b3df62211686fd09f319d8d2136e|1617656094",
      "Content-Type": "application/json",
      "Connection": "keep-alive",
      "Cookie": "username-localhost-8890=\"2|1:0|10:1617759437|23:username-localhost-8890|44:M2VmZjk5NTNlMWI1NDhlZGI5YTA2ZDM4OTJkOGJlN2M=<<<COOKIES CUT OUT>>>\"",
      "Pragma": "no-cache",
      "Cache-Control": "no-cache"
    }
[E 2021-04-14 00:25:35.943 ServerApp] 500 GET /api/nbconvert?1618374334947 (127.0.0.1) 409.91ms referer=http://localhost:8888/lab

I use jupyter notebook. For jupyterlab, the relevant files might be different.

Zalfrin commented 3 years ago

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.

This solution worked for me. In my case I opened C:\Users\\miniconda3\envs\\Lib\site-packages\latex_envs and ...\jupyter_contrib_nbextensions in VSCode and did the find/replace all.

s-tomar commented 3 years ago

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/...)

I can confirm that these changes have fixed the warning messages on my setup (MacOS 10.14.6, miniforge3, Python 3.9, jupyter_contrib_nbextensions 0.5.1).

immrdg commented 3 years ago

if anyone have the same issue and if you dont want those errors to rasie ,,, just execute this and dont update nbconvert again.... "pip install nbconvert==5.6.1"..

Wlmtest commented 2 years ago

The solution conda install "nbconvert=5.6.1" worked for me. The 404 errors about "template_path" not recognized went away.

I see several suggestions here to use PIP to solve this problem. Unless you used PIP manually to install nbconvert yourself, then don't uninstall it with PIP; do it with conda or you may corrupt your conda user environment.

I want to caution new Python programmers to NOT use mix pip and conda command line instructions to install and uninstall packages in your base environment, unless you REALLY know what you are doing. You can royally mess up for Anaconda installation to the point where you will be chasing your tail until you completely uninstall and reinstall the entire Anaconda distribution. Always use conda to uninstall packages that were installed with conda ! Pip is not "conda friendly" because it does not reliably update the conda package index.

UPDATE FROM LAST POST ABOUT THIS:

I had the same problem in another conda environment. Using the conda install "nbconvert=5.6.1" was not working; it took forever and never finished. I did a pip uninstall nbconvert in the conda environment. Then I did a conda update --all and that actually installed nbconvert=5.1.3, which is what I needed. So once again conda's integrity-checking algorithm repaired an environment that pip messed up. Very nice.

4/14/2021 UPDATE: Today with a new conda environment running Python 3.9, the nbconvert=5.6.1 downgrade solution refused to work:

# conda install "nbconvert=5.6.1"
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - nbconvert=5.6.1 -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.6,<3.7.0a0']

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

So now I will try the manual hacks that other people in this thread have suggested.

But my question is why does NBconvert need a version of Python < 3.9 ??

- nbconvert=5.6.1 -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.6,<3.7.0a0']

What "breaking changes" occured in Python 3.9 to make Nbconvert kick up these config option messages in Jupyter ServerApp?

i have the same problem, i run the command conda install "nbconvert<6" and choose the version 5.5.0 solve this problem

OscarMCY commented 2 years ago

So at present, this problem is still not fixed? 😂

stefansimik commented 2 years ago

Still not fixed Jupyterlab's console is full of errors 🙏😭

autonopy commented 2 years ago

For those looking for a temporary quick-fix, I made a new environment in Anaconda using Python 3.8.12 and everything installed quickly and runs perfectly.

Jdbeck66 commented 2 years ago

So it seems like Lenvs either cant refactor their code to add an s to template_path or doesn't want to? This is 1.25 year's old and seems like it should be an easy fix? But the only solution is that we can roll back nbconvert to a old version?

stefansimik commented 2 years ago

So it seems like Lenvs either cant refactor their code to add an s to template_path or doesn't want to? This is 1.25 year's old and seems like it should be an easy fix? But the only solution is that we can roll back nbconvert to a old version?

If I understand it correctly, you are right. It is still not solved problem and we have to roll back nbconvert to an old version right now.

Pull request to fix this already exists:

@demotu wrote: I opened pull requests with these changes:

but it cannot run without some CI dependent errors (don't know details), so it was not merged yet. That's the problem.

Jdbeck66 commented 2 years ago

That repo hasn’t had a commit in 5 years and the owner hasn’t been active in a year. Can it be deprecated in Jupyter or be removed from the extensions?

JB

On Fri, Dec 17, 2021 at 10:35 AM Stefan Simik @.***> wrote:

So it seems like Lenvs either cant refactor their code to add an s to template_path or doesn't want to? This is 1.25 year's old and seems like it should be an easy fix? But the only solution is that we can roll back nbconvert to a old version?

If I understand it correctly, you are right. It is still not solved problem and we have to roll back nbconvert to an old version right now.

Pull request to fix this already exists:

@demotu https://github.com/demotu wrote: I opened pull requests with these changes: jfbercher/jupyter_latex_envs#58 https://github.com/jfbercher/jupyter_latex_envs/pull/58

1532

https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1532

but it cannot run without some CI dependent errors (don't know details), so it was not merged yet. That's the problem.

— Reply to this email directly, view it on GitHub https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1529#issuecomment-996899726, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZNPS37JECR4DWH5JF3WNLURNYG7ANCNFSM4RQXDBMQ . You are receiving this because you commented.Message ID: @.*** .com>

-- Jim Beck Ph.D. Student - Computing, Computational Math, Science, and Engineering Boise State University

GlassGruber commented 2 years ago

I've been able to resolve this rather easily in 2 steps:

  1. Update the jupyter_contrib_nbextensions repo manually as detailed in the docs here. This is important because the normal install via pip (don't know about conda but I think it should be the same) will install release 0.5.1 which is several commits behind and does not include the merged patch https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1532.
  2. Edit the file site-packages/latex_envs/latex_envs.py replacing all template_path with template_paths, use the PR https://github.com/jfbercher/jupyter_latex_envs/pull/58 as reference. Unfortunately the patch is not yet merged, but it's a simple fix that can be done locally.

AFAICT this is working with no obvious side effect. For posterity, I've updated jupyter_contrib_nbextensions to commit https://github.com/ipython-contrib/jupyter_contrib_nbextensions/commit/a186b18efaa1f55fba64f08cd9d8bf85cba56d25.

Cheers!

leo-smi commented 2 years ago

Still not working

stefansimik commented 2 years ago

Still not working

Exactly, I can confirm, still not working.

ljburtz commented 2 years ago

I use this (not great) workaround..

## Install nbextensions for convenient snippets
# the last three lines are a temporary fix to a version mismatch with nbconvert https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1529
RUN pip3 install --user jupyter_contrib_nbextensions \
&& jupyter contrib nbextension install --user \
&& jupyter nbextension enable --user snippets/main \
&& pip3 uninstall jupyter-latex-envs -y \
&& sed -i 's/template_path/template_paths/g' /home/lpe/.local/lib/python3.8/site-packages/jupyter_contrib_nbextensions/nbconvert_support/toc2.py \
&& sed -i 's/template_path/template_paths/g' /home/lpe/.local/lib/python3.8/site-packages/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py
eliselavy commented 2 years ago

The solution for us was to downgrade the version of notebook. We have this problem with the plugin cite2c ( https://github.com/takluyver/cite2c) Came back to a version <= 6.2.0 for jupyter notebook solved the problem. By the anaconda navigator need to select the appropriate version (see screenshot)

Screenshot 2022-04-07 at 16 36 31

As you can see, i run with nbconvert at 6.0.7

jupyter core : 4.7.1 jupyter-notebook : 6.2.0 qtconsole : 5.0.2 ipython : 7.21.0 ipykernel : 5.3.4 jupyter client : 6.1.7 jupyter lab : 3.0.12 nbconvert : 6.0.7 ipywidgets : 7.5.0 nbformat : 5.0.8 traitlets : 5.0.5

fip17 commented 2 years ago

Thanks for all the great ideas. No resolution here. Still a problem on startup of JupyterLab.

lukelbd commented 2 years ago

Looks like https://github.com/jfbercher/jupyter_latex_envs/pull/58 was just merged. Seems it is not yet updated on pypi, but installing the master branch using e.g. pip install git+https://github.com/jfbercher/jupyter_latex_envs.git (this might require a pip uninstall jupyter_latex_envs first) appears to finally fix this issue. You will also have to install the master branch of jupyter_contrib_nbextensions so that the #1532 pull request is included, using e.g. pip install git+https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git (see also the above comment).

chetianjian commented 2 years ago

It's July 2022 now and the version of nbconvert has been upgraded to 7.0.0, has the problem been fixed by the developers? I tried so many times before and even made my environment collapsed several times, so I choose not to take the risk this time :(

stefansimik commented 2 years ago

It's July 2022 now and the version of nbconvert has been upgraded to 7.0.0, has the problem been fixed by the developers? I tried so many times before and even made my environment collapsed several times, so I choose not to take the risk this time :(

I am also interested, situation is quite unreadable for me too.

juhasch commented 2 years ago

I have removed the dependency on jupyter_latex_envs now in PR #1601. I will make a release in the next days, so the error messages should not cotinue to pop up in a news installation. You can still manually install the jupyter_latex_envs extension manually from jfbercher's the master branch.

chetianjian commented 1 year ago

Yeah, I think the problem still exists, so I decided to downgrade the nbconvert to 5.6.1 again. Fortunately, no side-effect was caused this time.

kamua commented 1 year ago

I'm tested @lukelbd's tips. Currently, this command sequence installs the Jupyter notebook extensions without any errors:

pip install git+https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git
pip install git+https://github.com/jfbercher/jupyter_latex_envs.git
jupyter contrib nbextension install --user

Thank you, @lukelbd!

stefansimik commented 1 year ago

@kamua I tested it with the 3 lines above, and it DOES NOT REALLY work. I mean, it really installs nicely without any error - but at the end - export in html_toc format does NOT work correctly.

I tested it with latest jupyterlab v3.4.5

I am attaching both files:

Both files in attached zip: test.zip