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.

Right click "Convert a Notebook to Python Script" doesn't work.

See original GitHub issue

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

  1. Open a workspace
  2. Right click on an ipynb file
  3. Choose “Convert a Notebook to a Python Script”

Fails. Here’s the log from an attempt I made. Note that my default Python interpreter is not set to PythonCodingPack\python.exe. However, it IS the python that’s found first based on my Windows System Path setting. Guessing that’s where this is coming from.

> ~\AppData\Local\Programs\PythonCodingPack\python.exe -m jupyter nbconvert --version
Info 2021-10-01 11:55:22: Process Execution: > ~\AppData\Local\Programs\PythonCodingPack\python.exe -m jupyter nbconvert --version
> ~\AppData\Local\Programs\PythonCodingPack\python.exe -m jupyter nbconvert --version
Error 2021-10-01 11:55:22: Export failed [Error: Importing notebooks requires Jupyter nbconvert to be installed.
	at g.importFromFile (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001286107\out\client\extension.js:52:973776)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async s.export (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001286107\out\client\extension.js:52:923161)
	at async b.exportToFormat (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001286107\out\client\extension.js:52:920676)
	at async b.performExport (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001286107\out\client\extension.js:52:919861)
	at async b.export (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001286107\out\client\extension.js:52:919375)
	at async g.export (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001286107\out\client\extension.js:37:290037)
	at async l._executeContributedCommand (c:\Users\jimg\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:111612)]
Info 2021-10-01 11:55:51: Notebook Closed file:///c%3A/Users/jimg/Repos/covid-19-data-1/SampleNbsAndScripts/test4nb.ipynb

VS Code Version

Version: 1.61.0-insider (user setup) Commit: 4fbe0344a0cedaf2a04edef728c9a3f27777cc6c Date: 2021-09-29T05:38:00.706Z Electron: 13.5.0 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.22468

Jupyter Extension Version

v2021.9.1001286107

Jupyter logs

See above

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Oct 18, 2021

This should be working after Ian’s change.

0reactions
greazercommented, Oct 25, 2021

Worked for me. Didn’t test thoroughly though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - converting from .py to .ipynb - Stack Overflow
Use p2j to convert Python source code to Jupyter Notebook. From the command line, run -->pip install p2j. then go to the directory...
Read more >
From Jupyter Notebook To Scripts. Don't play toy models
We can write a big Jupyter Notebook, click “Restart & Run All” and ... The first step is to convert the notebook to...
Read more >
Windows does not recognize .py file extension as a Python File
Right-click a .py file to get the context menu, and from “open with”, select “choose another app”. This dialog should have a box...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
If you have an existing Jupyter Notebook, you can open it by right-clicking on the file and opening with VS Code, or through...
Read more >
Notebooks in ArcGIS Pro—ArcGIS Pro | Documentation
To open an existing notebook in your project, browse to the notebook file in the Catalog pane and either double-click the notebook, or...
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