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.
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.
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.
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.
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.
Exporting notebooks to script requires Jupyter nbconvert but users is not prompted to do so. · Issue #5222 · microsoft/vscode-jupyter · GitHub
On windows, installing it on the default python and restarting vscode fixed the issue.
conda install nbconvert
or pip install nbconvert
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With