Jupyter notebook Export as Python Script FAILED
See original GitHub issueBug: 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:
- Created 3 years ago
- Comments:19 (9 by maintainers)
Top GitHub Comments
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.
Thanks for reporting this issue. Please could you try the following:
Python: Create Terminal
, & wait for the environment to besys.executable
in the terminal in thepython prompt
.