22

This is the error message displayed when I run the code in Interactive window in vs code:

C:\Users\rohit\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py:2195: FutureWarning: Supporting extra quotes around Unicode is deprecated in traitlets 5.0. Use 'hmac-sha256' instead of '"hmac-sha256"' – or use CUnicode. warn( C:\Users\rohit\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py:2150: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '8fe74386-11f1-4831-b37d-5582442edf8a' instead of 'b"8fe74386-11f1-4831-b37d-5582442edf8a"'. warn( Traceback (most recent call last): File "c:\Users\rohit.vscode\extensions\ms-toolsai.jupyter-2021.5.702919634\pythonFiles\vscode_datascience_helpers..\pyvsc-run-isolated.py", line 30, in runpy.run_path(module, run_name="main") File "F:\Anaconda\lib\runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "F:\Anaconda\lib\runpy.py", line 97, in _run_module_code _r...


I tried re-installing VS code (In another DRIVE F:). I am using python(conda) interpreter.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
THE TECHIE HAND
  • 426
  • 1
  • 4
  • 8
  • Same error here: ` Kernel died with exit code 1. Traceback (most recent call last): File "C:\Users\ryan\Miniconda3\envs\col1\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\ryan\Miniconda3\envs\col1\lib\runpy.py", line 85, in _run_code exec(code, run_globals) ... File "C:\Users\ryan\Miniconda3\envs\col1\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in from . import (constants, error, message, context, ImportError: DLL load failed: The specified module could not be found. ` – Ryan Apr 16 '21 at 06:11
  • I tried reinstalling anaconda and vscode. – THE TECHIE HAND Apr 17 '21 at 15:48
  • and also try running vscode from anaconda prompt shell with admin privileges.. type 'code' in the shell and hit enter. VSCode automatically starts and then press Ctrl+Shift+P amd select python(conda) interpreter. This worked for me. – THE TECHIE HAND Apr 17 '21 at 15:52
  • Thanks. The issue was resolved on its own. Maybe it was because the Conda environment was just created and VS Code for some reason couldn't start Jupyter notebook. Once I started Jupyter notebook from conda, it may have resolved the issue for VS Code too. – Ryan Apr 20 '21 at 03:12

9 Answers9

9

Also a solution here:

conda install ipykernel --update-deps --force-reinstall
Evgeny
  • 4,173
  • 2
  • 19
  • 39
7

This fix it from terminal

pip install pywin32==228

Deybi Morales
  • 106
  • 1
  • 2
  • 4
    ERROR: Could not find a version that satisfies the requirement pywin32==228 (from versions: 302, 303, 304) – sebas Sep 23 '22 at 20:22
3

1-Open Vs code choose your Kernal and Reinstall ipykenel

(Don't press anything keep reinstall till it works) Keep your kernal open while you doing this step by opening any notebook in the browser using Jupiter notebook normally And it will Work

or

Go to terminal open it as admin.

  • conda activate base
  • conda install --name base ipykernel -y
  • refresh the kernel by opening the jupyter note book from vscode terminal
  • -Choose the kernal you updated with ipykernel in vscode

this worked for me

Mohamed Fathallah
  • 1,274
  • 1
  • 15
  • 17
3

Issue:

Kernel died with exit code 1073741845.

1. c:\anaconda\envs\my_env\lib\site-packages\traitlets\ traitlets.py :2196: FutureWarning: Supporting extra quotes around Unicode is deprecated in traitlets 5.0. Use 'hmac-sha256' instead of '"hmac-sha256"' – or use CUnicode.

2. warn( c:\anaconda\envs\my_env\lib\site-packages\traitlets\traitlets.py:2151: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '7aa5b615-129a-4e47-b483-0954be3b7001' instead of 'b"7aa5b615-129a-4e47-b483-0954be3b7001"'.

3. warn( Bad file descriptor (bundled\zeromq\src\epoll.cpp:100)

Solution:

To solve 1. & 2. using the following commend in vscode python terminal:

python -m pip install traitlets==4.3.3 --force-reinstall (maybe need run 2 times and shows successfully install)

just reinstall the traitlets to the lower version.

To solve 3. using the following commend in vscode python terminal:

python -m pip install pyzmq==19.0.2 --force-reinstall (maybe need run 2 times and shows successfully install)

just reinstall the pyzmq to the lower version.

ranningw
  • 41
  • 4
2

In addition to what THE TECHIE HAND recommended- I opened a python terminal in VS Code and launched jupyter notebook from there. It opened in my web browser and allowed me to set a python 3 kernel, which then enabled Jupyter to work in VS Code.

2

Open your VS code, uninstall Python and Jupyter extensions and reinstall them again.

user2662006
  • 2,246
  • 22
  • 16
0

I fixed this by:

  1. Opening Anaconda Navigator
  2. Switching to the correct conda environment with the menu at the top
  3. Opening VS Code from the Anaconda navigator

For some reason, this made the interactive window work again.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Unique Divine
  • 151
  • 2
  • 5
0

This problem has occured to me as well , In my case I had code.py file removing it had seemed to have solved my problem

Sarath
  • 9
  • 1
0

Had the same issue with VS Code. Issue got fixed by

  1. Uninstalling Anaconda
  2. Removing Anaconda from /opt and ~/opt (credits / video)
  3. Reinstalling Anaconda.

Important Note - I assume this issue was with IPython 8.1.1. After reinstall from an existing package the version changed to 7.29.0 with Python 3.9.7 and it works.

Freddy Mcloughlan
  • 4,129
  • 1
  • 13
  • 29
ecoz
  • 1