could not install ipykernel. if pip is not available. please use the package

Viewed 5118

I am working on a .ipynb file in visual studio code for the first time. I ran a small code:

import numpy as np
import pandas as pd

# Set random seed to ensure reproducible runs
RSEED = 50

but it is not running, this error pops up:

could not install ipykernel. if pip is not available. please use the package...

1 Answers

To use Jupyter to execute python code in VS Code, we need to have the following conditions:

  1. Python is installed and available on the computer.

    After downloading and installing python, enter "python" in the terminal that comes with the system to check whether it enters the python interactive window.

    enter image description here

  2. Install the "python" extension and the "Jupyter" extension in VS Code.

  3. Install Jupyter's kernel "ipykernel".(pip install ipykernel In the VS Code internal terminal.)

run:

enter image description here

Reference: Jupyter in VS Code.

Related