Also a solution here:
conda install ipykernel --update-deps --force-reinstall
Answer from Evgeny on Stack OverflowKernel died with exit code 1.
kernel died with exit code 1. What does this mean?????????????????
Kernel died with exit code 1. What does this mean????
Whenever you see an error with a big stack trace like this, the real problem tends to be at the bottom:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\logging_init_.py", line 28, in <module>
from string import Template
ImportError: cannot import name 'Template' from 'string' (c:\Users\ryweb.vscode\string.py)
What it looks like to me is that from string import Template is intending to import a symbol from the standard string library that's part of your Python installation (which you installed in C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0). However, what it's finding instead is a file you wrote yourself -- c:\Users\ryweb\.vscode\string.py -- that doesn't provide Template.
In other words, by creating your own file named string.py, you have overridden and blocked access to the system's string library. Unless that's what you intended, you should probably name your file something else.
'Kernel died with exit code 1' Error with Jupyter Notebook in VS Code - Stack Overflow
So i'm trying to do python in visual studio code but whenever i run any code i get this:
Kernel died with exit code 1. Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\ryweb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\Users\ryweb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\ryweb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ipykernel\connect.py", line 12, in <module>
import jupyter_client
File "C:\Users\ryweb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\ryweb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\ryweb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\ryweb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\jupyter_client\channels.py", line 4, in <module>
import asyncio
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 18, in <module>
import concurrent.futures
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\concurrent\futures\__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\concurrent\futures\_base.py", line 7, in <module>
import logging
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\logging\__init__.py", line 28, in <module>
from string import Template
ImportError: cannot import name 'Template' from 'string' (c:\Users\ryweb\.vscode\string.py)
on top of that it says "connecting to python 3.9.7 64-bit(windows store)..." can someone help me please????????????????????
I got the same error message because the jupyter package was missing in my selected environment.
pip install jupyter
resolved the problem for me.
From the official VS Code documentation:
To work with Python in Jupyter Notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you've installed the Jupyter package.
Could you try to reinstall the pyzmq module?
pip uninstall pyzmq
pip install pyzmq==19.0.2
The version number may be different depending on the jupyter-client version.