question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter command `jupyter-nbconvert` not found in VS Code on Win10

See original GitHub issue

I was trying to export my jupyter notebook in the VS Code to html or pdf. However when I exported it, the process automatically breaked and throwed exception as Jupyter command jupyter-nbconvert not found. I have gone through version check and found that nbconvert and jupyter were installed. Therefore I dont know why the process would failed.

Environment data

  • VS Code version: 1.52.1
  • Jupyter Extension version (available under the Extensions sidebar): 6.1.4(core)
  • Python Extension version (available under the Extensions sidebar): 3.7.5
  • OS (Windows | Mac | Linux distro) and version: Win 10
  • Python and/or Anaconda version: 3.7.5

Expected behaviour

Convert the jupyter notebook to html

Actual behaviour

the process breaks

Steps to reproduce:

Logs

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

`

D:\Python\Python37\python.exe c:\Users\木辛.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\pythonFiles\pyvsc-run-isolated.py jupyter nbconvert c:\Users\木辛\AppData\Local\Temp\5e90ef96-fd0c-44c3-851a-72578f6922b4\Lab04-11711203.ipynb --to html --output tmp-8180nJyFVOI4wzPo.html --output-dir ~\AppData\Local\Temp --debug D:\Python\Python37\python.exe c:\Users\木辛.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\pythonFiles\pyvsc-run-isolated.py jupyter nbconvert c:\Users\木辛\AppData\Local\Temp\5e90ef96-fd0c-44c3-851a-72578f6922b4\Lab04-11711203.ipynb --to html --output tmp-8180nJyFVOI4wzPo.html --output-dir ~\AppData\Local\Temp --debug Error 2021-01-12 11:14:22: Export failed [Error: Traceback (most recent call last): File “c:\Users\木辛.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\pythonFiles\pyvsc-run-isolated.py”, line 26, in <module> runpy.run_module(module, run_name=“main”, alter_sys=True) File “D:\Python\Python37\lib\runpy.py”, line 205, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File “D:\Python\Python37\lib\runpy.py”, line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File “D:\Python\Python37\lib\runpy.py”, line 85, in _run_code exec(code, run_globals) File “C:\Users\木辛\AppData\Roaming\Python\Python37\site-packages\jupyter.py”, line 4, in <module> main() File “C:\Users\木辛\AppData\Roaming\Python\Python37\site-packages\jupyter_core\command.py”, line 247, in main command = _jupyter_abspath(subcommand) File “C:\Users\木辛\AppData\Roaming\Python\Python37\site-packages\jupyter_core\command.py”, line 134, in _jupyter_abspath ‘Jupyter command {} not found.’.format(jupyter_subcommand) Exception: Jupyter command jupyter-nbconvert not found.

at a.executeCommand (c:\Users\木辛\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:1:448888)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async a.export (c:\Users\木辛\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:253800)
at async _.exportToFormat (c:\Users\木辛\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:252766)
at async _.performExport (c:\Users\木辛\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:251809)
at async _.export (c:\Users\木辛\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:251323)
at async m.export (c:\Users\木辛\.vscode\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:32:265964)]

`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
IanMatthewHuffcommented, Jan 20, 2021

@Jupiter-ZZC I believe that I didn’t specify that command right, you could try that again with a -m after python.exe. So python.exe -m jupyter nbconvert ....

A couple more quick things, could you get the version of nbconvert that you are working with? After pulling that you could try an uninstall and reinstall of nbconvert.

python -m pip uninstall nbconvert
python -m pip install nbconvert -U

If you have a bad version of nbconvert that might get you into a working state.

0reactions
avinashnelluricommented, Apr 22, 2021

@Jupiter-ZZC

I had a similar issue. In my case the solution was to to launch powershell as administrator in order to (re)install nbconvert. I usually use my pc from a restricted user account and so pip could not install the packages into the folder C:\Users\UserName\AppData\Roaming\Python\Python38\site-packages\ but into the folder C:\Users\UserName\AppData\Roaming\Python\Python38\Scripts\. There however it could not be found either by VS Code or python.exe.

Thank you @jf20191031 This resolved my issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - VScode fails to export Jupyter notebook to HTML
Available subcommands: 1.0.0 Jupyter command `jupyter-nbconvert` not found. I've tried to reinstall nbconvert using pip to no ...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
You can create a Jupyter Notebook by running the Create: New Jupyter Notebook command from the Command Palette (Ctrl+Shift+P) or by creating a...
Read more >
Working with Jupyter code cells in the Python Interactive window
Debug a Jupyter notebook; Export a Jupyter notebook. To work with Jupyter notebooks, you must activate an Anaconda environment in VS Code, or...
Read more >
nbconvert: Convert Notebooks to other formats — nbconvert ...
When used as a command line tool (invoked as jupyter nbconvert ... ), users can conveniently convert just one or a batch of...
Read more >
Get Started with C++ and Mingw-w64 in Visual Studio Code
In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found