I have an existing vanilla Python installed on my Windows 10 computer and I do not want to reinstall Anaconda.
When trying to run code from ipynb file in vscode, I get the following error:
Error: Jupyter cannot be started. Error attempting to locate jupyter:
at A.startServer (c:\Users\[username]\.vscode\extensions\ms-python.python-2020.2.64397\out\client\extension.js:1:786120)
at async A.ensureServerAndNotebookImpl (c:\Users\[username]\.vscode\extensions\ms-python.python-2020.2.64397\out\client\extension.js:1:785575)
at async A.ensureServerAndNotebook (c:\Users\[username]\.vscode\extensions\ms-python.python-2020.2.64397\out\client\extension.js:1:785376)
at async A.submitCode (c:\Users\[username]\.vscode\extensions\ms-python.python-2020.2.64397\out\client\extension.js:1:782328)
at async A.reexecuteCell (c:\Users\[username]\.vscode\extensions\ms-python.python-2020.2.64397\out\client\extension.js:75:879318)
Also with the following error from VSCode:
Below are some of the things I have tried:
Check if the VSCode Extension in Correctly Installed
"Jupyter" extensions is deprecated. I had the "Python" plugin from Microsoft installed which contained Jupiter Notebook support.
Jupyter Installed Correctly
I tried reinstalling jupyter:
> python -m pip install --upgrade pip
> pip install jupyter
> pip install notebook
Tried to Run Jupyter on Terminal/Command Line
> jupyter notebook //didn't work
jupyter : The term 'jupyter' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ jupyter
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (jupyter:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
This gave an error not able to find jupyter executable. According to this post I tried the following and it worked:
> python -m notebook
Check if pointing to the right interpreter
As per this post I tried:
- Press Command+Shift+P to open a new command pallete
- Type >Python: Select Intepreter to start jupyter notebook server
But I only had one version of Python installed on my computer, and doing this didn't make a difference.
Check the Path
There was this comment about PYTHONPATH
in this post but since the python directory is correctly referenced and python
works from the command line, I did not investigate it further.
One thing to note is pip
installs to my "C:/Users/[username]/appdata/Roaming/Python-38/"
folder while my Python is installed in "C:\Program Files\Python38-32\"
.