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

Cannot export to PDF #12062

Closed
juanjosegarciaripoll opened this issue Nov 17, 2022 · 2 comments
Closed

Cannot export to PDF #12062

juanjosegarciaripoll opened this issue Nov 17, 2022 · 2 comments

Comments

@juanjosegarciaripoll
Copy link

Environment data

  • VS Code version: 1.73.0
  • Jupyter Extension version (available under the Extensions sidebar): 2022.9.1303220346
  • Python Extension version (available under the Extensions sidebar): 2022.18.2
  • OS (Windows | Mac | Linux distro) and version: Windows
  • Python and/or Anaconda version: Miniconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Expected behaviour

I execute the command to export a notebook to PDF, it should run without problems, but apparently an extension that is not automatically installed is required.

Actual behaviour

The extension aborts with a message captured below

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Create a minimal conda environment
  2. Create a notebook in Visual Studio
  3. Let the extension install Jupyter's requirement
  4. Execute the command to export to PDF

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

[NbConvertApp] WARNING | Config option `template_path` not recognized by `PDFExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
Traceback (most recent call last):
  File "C:\Users\juanj\miniconda3\envs\iQ\Scripts\jupyter-nbconvert-script.py", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\jupyter_core\application.py", line 276, in launch_instance
    return super().launch_instance(argv=argv, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\traitlets\config\application.py", line 982, in launch_instance
    app.start()
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\nbconvert\nbconvertapp.py", line 426, in start
    self.convert_notebooks()
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\nbconvert\nbconvertapp.py", line 595, in convert_notebooks
    self.exporter = cls(config=self.config)
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\nbconvert\exporters\templateexporter.py", line 342, in __init__
    super().__init__(config=config, **kw)
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\nbconvert\exporters\exporter.py", line 118, in __init__
    self._init_preprocessors()
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\nbconvert\exporters\templateexporter.py", line 507, in _init_preprocessors
    super()._init_preprocessors()
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\nbconvert\exporters\exporter.py", line 279, in _init_preprocessors
    self.register_preprocessor(preprocessor, enabled=True)
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\nbconvert\exporters\exporter.py", line 239, in register_preprocessor
    preprocessor_cls = import_item(preprocessor)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\juanj\miniconda3\envs\iQ\Lib\site-packages\traitlets\utils\importstring.py", line 30, in import_item
    module = __import__(package, fromlist=[obj])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'jupyter_contrib_nbextensions'

@juanjosegarciaripoll juanjosegarciaripoll added the bug Issue identified by VS Code Team member as probable bug label Nov 17, 2022
@Michitronik
Copy link

I have the same issue with VS Code V1.75.0 and Jupyther Extension Version V2023.1.2000312134.

Export is aborted withe the message for further information see output. But there is no information posted.

@rebornix rebornix added notebook-import-export and removed bug Issue identified by VS Code Team member as probable bug labels Dec 8, 2023
@rebornix rebornix assigned amunger and unassigned rebornix Dec 8, 2023
@amunger
Copy link
Contributor

amunger commented Dec 8, 2023

from searching around, it looks like this may be a problem in a specific nbconvert library from this comment.

You might be able to resolve this with an uninstall/reinstall of that package as is what helped here: #4347 (comment).

Let us know if you're still having trouble with this.

@amunger amunger closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants