Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Importing notebooks requires Jupyter nbconvert to be installed

I am trying to import an ipynb file in a Jupyter Notebook in VS Code. However I am getting the following error everytime:

Error 2021-01-02 00:31:20: Export failed [Error: Importing notebooks requires Jupyter nbconvert to be installed.
at u.getExportInterpreter (c:\Users\aviparna.biswas\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:32:546101)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async _.export (c:\Users\aviparna.biswas\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:251215)
at async c:\Users\aviparna.biswas\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:428354
at async u.waitWithStatus (c:\Users\aviparna.biswas\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:805850)
at async E.importNotebook (c:\Users\aviparna.biswas\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:428274)
at async E.listenForErrors (c:\Users\aviparna.biswas\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:423814)]

I have also used pip to install nbconvert in VS Code and also have restarted VS Code. The problem is persisting.

like image 774
Daremitsu Avatar asked Jan 01 '21 19:01

Daremitsu


People also ask

What is Jupyter Nbconvert?

The nbconvert tool, jupyter nbconvert , converts notebooks to various other formats via Jinja templates. The nbconvert tool allows you to convert an . ipynb notebook file into various static formats including: HTML. LaTeX.

Can jupyter nbconvert be used under Python?

It says converting the notebook to python requires "jupyter nbconvert" to be installed. It is installed within the virtualenv as you can see through the output of pip freeze. I expect it to convert the notebook. I didn't see anything under Python.

How do I install nbconvert in Python?

Nbconvert is packaged for both pip and conda, so you can install it with: pip install nbconvert # OR conda install nbconvert. If you’re new to Python, we recommend installing Anaconda, a Python distribution which includes nbconvert and the other Jupyter components.

How do I convert a Jupyter notebook to latex?

Although nbconvert comes installed with Anaconda, it can be installed with pip, too. You can convert your Jupyter notebook to some file formats, such as HTML, right out of the box. However, if you want to covert a notebook to LaTex, PDF, Ascii, reStructuredTExt, or Markdown, you’ll need to install Pandoc and LaTeX.

Is it possible to export notebooks to script from Jupyter?

Exporting notebooks to script requires Jupyter nbconvert but users is not prompted to do so. · Issue #5222 · microsoft/vscode-jupyter · GitHub


2 Answers

On windows, installing it on the default python and restarting vscode fixed the issue.

conda install nbconvert or pip install nbconvert

like image 188
Javi Carnero Avatar answered Sep 21 '22 03:09

Javi Carnero


If you run the "Jupyter: Select interpreter to start Jupyter server" command in vscode you should see an interpreter listed. Try making sure that nbconvert is installed into that interpreter / environment. That location should be the fallback location for import and export commands so if nbconvert is there your commands should all work.

like image 38
Ian Huff Avatar answered Sep 18 '22 03:09

Ian Huff