Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kernel died with exit code 1(VS code)

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.

like image 930
THE TECHIE HAND Avatar asked Apr 10 '21 15:04

THE TECHIE HAND


7 Answers

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.

like image 197
ranningw Avatar answered Oct 27 '22 16:10

ranningw


This fix it from terminal

pip install pywin32==228

like image 38
Deybi Morales Avatar answered Oct 27 '22 18:10

Deybi Morales


Also a solution here:

conda install ipykernel --update-deps --force-reinstall
like image 6
Evgeny Avatar answered Oct 27 '22 16:10

Evgeny


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

like image 3
Mohamed Fathallah Avatar answered Oct 27 '22 16:10

Mohamed Fathallah


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.

like image 2
FoodMoneyFun Avatar answered Oct 27 '22 17:10

FoodMoneyFun


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

like image 2
user2662006 Avatar answered Oct 27 '22 17:10

user2662006


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

like image 1
Sarath Avatar answered Oct 27 '22 17:10

Sarath