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 notebook Export as Python Script FAILED

See original GitHub issue

Bug: VS code, Jupyter Notebooks, Export as Python

Steps to cause the bug to occur

Actual behavior

The export as Python file doesn’t work from the Export as button (error: Jupyter command jupyter-nbconvert not found). However, if I run the nbconvert from command line (Python: Create Terminal) it does work.

Expected behavior

Jupyter Notebook exported as a py file. How to configure such that it works from the export as button?

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.9.114305
  • VS Code version: 1.50.1
  • Python and/or Anaconda version: 3.8.5
  • OS: Windows
  • Virtual environment: Dev Container: Python3

Python Output

/usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py jupyter nbconvert --version Error 2020-10-29 10:43:38: Export failed [r [Error]: Traceback (most recent call last): […] File “/root/.local/lib/python3.8/site-packages/jupyter_core/command.py”, line 133, in _jupyter_abspath raise Exception( Exception: Jupyter command jupyter-nbconvert not found.

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
DonJayamannecommented, Jan 6, 2021

Looks like a bug in nbconvert, now i recall we had a number of issues with nbconvert in the past. Please update to the latest version of nbconvert (6.0.7) & it will work. I just ran pip install nbconvert -U and that worked. YOu might want to remove teh version number from the requirements.txt file for nbconvert (interestingly that’s the only package that’s pinned to a specific version).

Thanks again for providing the information. Closing as updating the package fixes it.

1reaction
DonJayamannecommented, Oct 29, 2020

Thanks for reporting this issue. Please could you try the following:

  • Install the latest update of the Python extension
  • Take a screenshot of the bottom left VS Code statusbar (I’d like to see the python interpreter selected)
  • Open a terminal using Python: Create Terminal, & wait for the environment to be
  • Next print sys.executable in the terminal in the python prompt.
>> python
>> import sys
>> sys.executable
Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter notebook Export as Python Script FAILED · Issue #1681
Actual behavior. The export as Python file doesn't work from the Export as button (error: Jupyter command jupyter-nbconvert not found). However ...
Read more >
VSCode: Jupyter won't export as Python script - Stack Overflow
The instructions for exporting from a Jupyter notebook within VSCode are simple -- hit "Export As," then select "Python script." The error I ......
Read more >
Exporting the Jupyter Notebook - GitHub Pages
Extract executable Python script from Notebook. Execute notebook so that the result(s) of the code blocks is captured in a new notebook. Key...
Read more >
Export Jupyter Notebook as a Python file (.py), a PDF, or an ...
In this tutorial session, we will learn to export Jupyter Notebook as a Python file (.py), a PDF, or an HTML file. Step...
Read more >
jupyter-nbconvert not found | The AI Search Engine You Control
Actual behavior. The export as Python file doesn't work from the Export as button (error: Jupyter command jupyter-nbconvert not found).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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