-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel crashes when creating a matplotlib plot #15834
Comments
Sorry for not getting back to you on this issue.
This seems to be an issue with kernel dying due to external issues. VS Code doesn't really causes crashes, its the Python code that is running in the kernel thats causing the kernel to crash and thats actually beyond the control of VS Code. Pelase can you try running the same notebook outside VS Code against the exact same Python environment and try again. |
@DonJayamanne Visual Studio Code (1.91.1, wsl, desktop) This problem must arise. import matplotlib.pyplot as plt There are two questions now. |
I'm sorry however I am struggling to understand the problem now.
What do you mean by this? Can you try the following:
import matplotlib.pyplot as plt
plt.figure()
plt.plot([1,2], [1,2])
plt.show() Does this work? Given the fact taht you have mentioend about logs, scheduled deletion, eetc, I'm inclined to believe that this is caused by some code at your end. Also, does this issue repro, when you use Jupyter Lab? |
@DonJayamanne
from IPython.display import clear_output
|
Thanks, but Still struggling to understand the issue , please can you share a very simple notebook with a simple plot like the one I shared that can be used to replicate this issue Also can you share screenshots of the error messages, it’s difficult to tell what the problem is without those details |
import matplotlib.pyplot as plt
from IPython.display import clear_output
for i in range(6000):
#question 1 wsl path windows vscode project only print no clear_output and plt show Kernel crash
print(i)
clear_output(wait=True)
# or try false
#clear_output(wait=False)
plt.figure()
plt.plot([1,2], [1,2])
plt.show() @DonJayamanne |
Can you try laucnhing Jupyter Lab inside the same WSL enviorhnment from the same Python env |
I've tried this at my end , and it works as expected, took a while to run the cell, but it ran completely without any errors. |
@DonJayamanne Today, I discovered that the Juypter plugin has automatically updated Try opening the file project using Windows VSCode in the WSL path. Then only print. Not cleared. Can you reproduce the path error issue? |
@DonJayamanne import matplotlib.pyplot as plt
from IPython.display import clear_output
for i in range(6000):
clear_output(wait=True)
plt.figure()
plt.plot([1,2], [1,2])
plt.show()
print(i)
|
Please can you try using Jupyter lab and get logs from there when you repro it Instructions here |
@DonJayamanne |
The link was correct, basically please use Jupyter lab from the same environment Note, please ensure you have activated the python env as well
Btw, what kind of environment is this? Conda or virtual environment or other? |
@DonJayamanne |
Please install Jupyter into the same Python environment using the following script ‘d:\my\env\python3.10.10\python.exe -m pip install jupyterlab’ |
@DonJayamanne |
Can you share a screenshot of the output from the terminal when you run here above command |
Please can you confirm you ran this command ‘d:\my\env\python3.10.10\python.exe -m pip install jupyterlab’ I’m sorry, but can you try the above first, |
Than you for getting back with that information This proves that the problem is not with vscode I would suggest recreating the python environment, or using another environment and reinstalling the packages |
@DonJayamanne |
Applies To
What happened?
Error:
The Python 3.10.0 kernel in Jupyter Notebook continues to crash locally on my system. I have tried several solutions, including kernel restarts, code checks, and using a new virtual environment, but the issue persists. The detailed error message is as follows:
The kernel 'Python 3.10.0' died while executing code. Please check the kernel logs for more details.
Steps Tried:
Additional Details:
Thank you for your assistance in resolving this problem.
VS Code Version
Version: 1.91.0
Jupyter Extension Version
v2024.6.0
Jupyter logs
Coding Language and Runtime Version
Python v3.10.0
Language Extension Version (if applicable)
No response
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Local
The text was updated successfully, but these errors were encountered: