Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python requires ipykernel to be installed

I encounter an issue when I use the Jupyter Notebook in VS code. The screen shows "Python 3.7.8 requires ipykernel to be installed". I followed the pop-up to install ipykernel. It still does not work. The screenshot is attached. It bothers me a lot. Could anyone help me with it? Tons of thanks.

Screenshot of VSCode displaying the error message.

like image 630
johnwow Avatar asked Nov 25 '20 02:11

johnwow


People also ask

What is Ipykernel in Python?

The IPython kernel is the Python execution backend for Jupyter. The Jupyter Notebook and other frontends automatically ensure that the IPython kernel is available. However, if you want to use a kernel with a different version of Python, or in a virtualenv or conda environment, you'll need to install that manually.

What is Ipykernel package?

This package provides the IPython kernel for Jupyter.

How do I check my Python version Jupyter?

To check the Python version in your Jupyter notebook, first import the python_version function with “ from platform import python_version “. Then call the function python_version() that returns a string with the version number running in your Jupyter notebook such as "3.7. 11" .

How to install ipykernel in Python 2?

python2 -m pip install ipykernel python2 -m ipykernel install --user Or using conda, create a Python 2 environment: conda create -n ipykernel_py2 python=2 ipykernel source activate ipykernel_py2 # On Windows, remove the word 'source' python -m ipykernel install --user

Why is ipykernel not working in my environment?

Make sure you have ipykernel installed in your environment. If you are using pip to install ipykernel in a conda env, make sure pip is installed: For example, using conda environments, install a Python (myenv) Kernel in a first environment:

How do I install ipykernel in conda?

If you are using pip to install ipykernel in a conda env, make sure pip is installed: source activate myenv conda install pip conda install ipykernel # or pip install ipykernel. For example, using conda environments, install a Python (myenv) Kernel in a first environment:

How do I install a Python (myenv) kernel?

For example, using conda environments, install a Python (myenv) Kernel in a first environment: source activate myenv python -m ipykernel install --user --name myenv --display-name "Python (myenv)" And in a second environment, after making sure ipykernel is installed in it:


Video Answer


1 Answers

I had the same issue and spent the whole day trying to resolve it. What worked for me was installing the Jupyter dependencies for anaconda:

> conda install jupyter

I installed this in my base environment. After this VSCode worked without any errors.

like image 180
Neelabh Somani Avatar answered Sep 22 '22 10:09

Neelabh Somani