简体   繁体   中英

Problems executing jupyter notebook script from cmd in windows

First I added the 2 directory paths where I installed Anaconda3 in the Path system variable because I was getting this error:

'jupyter' is not recognized as an internal or external command.

ie 1. C:\\ProgramData\\Anaconda3

  1. C:\\ProgramData\\Anaconda3\\Scripts

However, I still cannot execute the script. I get a bunch of Tracebacks and the error at the end:

ImportError: DLL load failed: The specified module could not be found.

I am not sure where my script file needs to be but I tried 2 directories. First the initial directory where jupyter creates it and next I moved it inside the \\Anaconda3\\Scripts folder but both to no avail. I am also getting the same error if I try to run jupyter from cmd.

IPython notebooks are stored in .ipynb formats. While python files are of .py format. This being said, you'll have to convert the notebook to a python file.

cd into the directory your notebook exists and type the following in your command prompt

$ jupyter nbconvert --to script [NOTEBOOK_NAME].ipynb

A .py file with the same name should now be there in the same directory.

You can find other export options available, and the examples mentioned in their docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM