'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.
Solution 1:[1]
This fix it from terminal
pip install pywin32==228
Solution 2:[2]
Solution 3:[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
Solution 4:[4]
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.
Solution 5:[5]
Open your VS code, uninstall Python and Jupyter extensions and reinstall them again.
Solution 6:[6]
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
Solution 7:[7]
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.
Solution 8:[8]
I fixed this by:
- Opening Anaconda Navigator
- Switching to the correct conda environment with the menu at the top
- Opening VS Code from the Anaconda navigator
For some reason, this made the interactive window work again.
Solution 9:[9]
Had the same issue with VS Code. Issue got fixed by
- Uninstalling Anaconda
- Removing Anaconda from
/optand~/opt(credits / video) - 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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
