vscode-jupyter: Unable to instal ipykernel when opening an interactive window

Hi, I am trying to open an interactive window, but there seems to be a problem with the installation of ipykernel. I am new to python (and fairly new to VSCode), so would appreciate clear instructions.

Thanks in advance!

Steps to cause the bug to occur

  1. Type #%% before and after a line to create a cell for the Interactive Window
  2. Press Run Cell

Actual behavior

I get 2 pop-up messages on the bottom right corner saying

A: “Python 3.8.3 64-bit (‘myenv’: conda) requires ipykernel to be installed” B: “Connecting to IPython kernel: Fetching Kernels”

Comment A has an install button within the window, and when I click it, I get

` >& C:/Users/ivica/miniconda3/envs/myenv/python.exe c:\Users\ivica.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\pyvsc-run-isolated.py c:\Users\ivica.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\shell_exec.py conda install --name myenv ipykernel -y C:/Users/ivica/AppData/Local/Temp/tmp-20572SkUQWopUmqiq.log Executing command in shell >> conda install --name myenv ipykernel -y Collecting package metadata (current_repodata.json): done Solving environment: done

All requested packages already installed.`

(not where the first line starts… Should I worry about that?)

And, then, both messages A and B disappear and I get another pop-up C that says:

C: “IPyKernel not installed into interpreter Python 3.8.3 64-bit (‘myenv’: conda)”

I am using the correct python interpreter (Python 3.8.3 64-bit (‘myenv’:conda)).

Expected behavior

Don’t really know because I have never successfully run an interactive window, but I guess just run the selected cell.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Extension version: v2020.9.112786
  • VS Code version: 1.49.2 (user setup)
  • Setting python.jediEnabled: false? (I never enabled or disabled this, or interacted with it in any other way. Can’t find Setting python.jediEnabled)
  • Setting python.languageServer: Jedi
  • Python and/or Anaconda version: Python: 3.8.3, Miniconda3
  • OS: Windows
  • Virtual environment: I think myenv is not a virtual environment, but I am fairly new and am not entirely sure.

Thanks in advance

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Thanks a lot! I followed one of the suggested solutions in jupyter/notebook#3435 (pip uninstall pyzmq pip install pyzmq) and now ipykernel can be imported from the python repl of my environment on the anaconda prompt.

However, now I get the “Timed out waiting to get a heartbeat from kernel process.” error when I try to Run Cell in the interactive window on VSCode. This is the new log:

-1601931395378.log

Thank you! One of the solutions posted on that issue actually worked!!!

I installed pywin23==227 from the conda forge channel inside my environment, and now the interactive window works! Thank you very much @IanMatthewHuff for getting involved and helping out!