2

I am having trouble running my import statement in VS code Jupyter. I split them into individual cells. I find when I run

import numpy as np

the cell hangs and I get a message

Connecting to kernel: Python 3.6.9: Waiting for Jupyter Session to be idle

How do I fix this?

arame3333
  • 9,887
  • 26
  • 122
  • 205

5 Answers5

2

To solve it, I uninstalled the extension Jupyter notebook (which requires a reload), and then installed it.

JinSnow
  • 1,553
  • 4
  • 27
  • 49
0

This may be related to the extended version. I hope this article is helpful to you.

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13
0

Alright so this one surprised me..

I was using Jupyter-like code cells "#%%" (see docs) to run jupyter notebook in VSCode. And I ran into the same issue as OP.

The error disappeared when I renamed my file, from "inspect.py" to "tmp.py".

Tom O
  • 2,495
  • 2
  • 19
  • 23
0

I found my solution was to select the correct version of Python. I had 2 choices for Python 3.6.9. I chose the one called "base(Python 3.6.9)" which had a different location to "Python 3.6.9" and the base version worked. Something odd if going on here, maybe I should remove the other version?

arame3333
  • 9,887
  • 26
  • 122
  • 205
0

For me, upgrading ipython to version 7.34.0 (from 7.32.0) fixed it. I'm using jedi version 0.18.1. Related

Update: this broke again for me when I upgraded my virtual environment to Python 3.8. I just upgraded my ipykernel package and now the notebook runs.

chicxulub
  • 210
  • 2
  • 5