This document is intended to help troubleshoot problems in the Python Interactive Window.
This error can happen when you
- Don't have Jupyter installed
- Have picked the wrong Python environment (one that doesn't have Jupyter installed).
The python you're using is picked with the selection dropdown on the bottom left of the VS Code window:
To verify this version of python supports Jupyter notebooks, start a 'Python: REPL' from the command palette and then type in the following code:
import jupyter_core
import notebook
jupyter_core.version_info
notebook.version_info
If any of these commands fail, the python you have selected doesn't support launching jupyter notebooks.
Failures would look something like:
>>> import jupyter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named jupyter
>>> import notebook
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named notebook
>>>
You can do this in a number of different ways:
Anaconda is a popular Python distribution. It makes it super easy to get Jupyter up and running.
If you're already using Anaconda, follow these steps to get Jupyter
- Start anaconda environment
- Run 'conda install jupyter'
- Restart VS Code
- Pick the conda version of Python in the python selector
Otherwise you can install Anaconda and pick the default options https://www.anaconda.com/download
You can also install Jupyter using pip.
- python -m pip install --upgrade pip
- python -m pip install jupyter
- Restart VS Code
- Pick the Python environment you did the pip install in
For more information see http://jupyter.org/install