0

When I was running a jupyter note on vscode

`

# Load the libraries to be used in the Analysis

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
impor wat warnings

# Setup libraries settings and options
## Pandas setup
pd.set_option('display.max_columns', None)

## matplotlib setup
%matplotlib inline

## Seaborn setup
sns.set_context('notebook')
sns.set_style('whitegrid')
sns.set_palette('Blues_r')

# turn off warning for final notebook
warnings.filterwarnings('ignore')

`

I then got asked to install ipykernel, when i choose install from vscode the process starts then i get this error message: Running cells with 'Python 3.11.0 64-bit' requires ipykernel package. Run the following command to install 'ipykernel' into the Python environment. Command: 'c:/Users/Samir/AppData/Local/Programs/Python/Python311/python.exe -m pip install ipykernel -U --user --force-reinstall'

I go to Git Bash and run

python -m pip install ipykernel

I get this Error

\tests
      running build_ext
      building 'psutil._psutil_windows' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Micr
osoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tool
s/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem wit
h pip.
  ERROR: Failed building wheel for psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject
.toml-based projects

I tried to install the ipykernel from vscode then from Git bash but i get an Error

  • 1
    Have you tried what the message suggests? `c:/Users/Samir/AppData/Local/Programs/Python/Python311/python.exe -m pip install ipykernel -U --user --force-reinstall`. And in fact it also suggests getting a compiler from https://visualstudio.microsoft.com/visual-cpp-build-tools/ – tevemadar Oct 28 '22 at 07:43
  • i use `vs code` in `windows` and it works from the prompt inside `vs code`. I believe it installs the `jupyter` extension... – D.L Oct 28 '22 at 08:36

1 Answers1

1

'c:/Users/Samir/AppData/Local/Programs/Python/Python311/python.exe -m pip install ipykernel -U --user --force-reinstall'

Obviously, it has told you how to install.

But please note that this is an environmental issue, so make sure you choose the correct interpreter.

You can use the shortcut key Ctrl+Shift+ to open a new VScode terminal, it will automatically enter the currently selected VSCode environment.

And use command pip install ipykernel to install ipykernel.

Alternative method:

Use following command in the terminal to reinstall pyzmq package.

pip uninstall pyzmq
pip install pyzmq
MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13