VSCode: Jupyter won't export as Python script

Viewed 3324

I'm trying not to get too frustrated with VSCode and the scattered subfolders it's been creating, but I'm tearing my hair out over this one:

The instructions for exporting from a Jupyter notebook within VSCode are simple -- hit "Export As," then select "Python script." The error I get is: "Export failed. Please check the 'Python' output panel for further details."

The output panel includes this:

    raise ValueError('No template sub-directory with name %r found in the following paths:\n\t%s' % (base_template, paths))
ValueError: No template sub-directory with name 'python' found in the following paths:
    C:\Users\dures\AppData\Roaming\jupyter
    c:\program files (x86)\python\share\jupyter
    C:\ProgramData\jupyter 

I've created the relevant sub-directories, but I have no idea how to create a "template sub-directory."

More generally, is there a better way to make sure everything I want to use in VSCode is in the same place and on PATH?

2 Answers

Check and confirm you're using Python 3.7 and above. See the image to below

You're likely running Python 3 or a lesser version not supported.

Where to see the python version running

Install these libraries, then try again:

%pip install nbconvert
%pip install pandoc
%pip install pyppeteer
Related