-
Notifications
You must be signed in to change notification settings - Fork 300
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
aggdraw.Draw
causes kernel to die, not in web interface, only in VS Code
#14243
Comments
Please could you enable logging as follows:
|
Hi @DonJayamanne, here you go:
BTW: The message |
based on the logs you are running the code against a remote Jupyter kernel. I find I it hard to understand how it didn’t fail when you run the same code outside vscode, as is the exact same environment Can you code the variables view on the bottom of your screen. I think that panel is open, please close that and try again |
"Can you code the variables view": I assume this was a typo. You are correct. The variable view was open and when I closed it the error disappeared. The lower-right popup-notification Without the variables view the UI is consistent and healthy. Furthermore, if I replace But: If I then add the assignment to a variable and re-run the cell, then the variables view will show The following won't cause the kernel to die: Cell 1:
Cell 2:
Then Run-All. Then the variables view can stay open and will show |
Regarding the last added information with the two cells: This works in a simple notebook, but not in a larger one. In any case, closing the variable view "fixes" the issue 100%. |
@danielfaust Are you still running into this issue with the latest version of Jupyter exetnsion? If you can still repro this, please can you share the following logs
|
@DonJayamanne this is still happening ( extension version: v2023.10.1100000000 ):
This cell is the only one in the notebook:
and outputs this result:
It still applies that if the "Variables"-panel is collapsed, then the Kernel doesn't crash. Turns out that running only the following cell no longer triggers a Kernel crash, so apparently now the behavior is different:
This small cell used to cause the problem as well. I noticed that in the example cell which does cause a crash, the "Variables"-panel does not show any variables at all ("no variables defined") |
Plese can you try the following:
|
VS code is running on one machine (Windows) and Jupyter on another one (in a Linux VM hosted on a server) which I access via the SSH Remote extension. When I use Jupyter's web interface via http://host:port/lab/tree/notebooks/Mapping/Aggdraw-Test.ipynb then the Kernel does not crash. I'm not sure if I understood you correctly, if you want me to move the Jupyter server locally to the machine. But even then I'd run it in WSL which would basically be the same as running it remotely (I don't use WSL at all). I would not want to install Jupyter and all the dependencies of the environment in which that Kernel is running in onto another machine. But what I just tested was running another instance of VS code inside a Ubuntu Desktop VM on the Windows machine and have it use the same remote Jupyter instance. The same error happens in this Ubuntu VM, so all I can tell you is that it is not a Windows-only issue. |
Yes thats what I wanted you to try. thanks |
Btw, I can now replicate this at my end |
Steps to repro
import aggdraw
from PIL import Image, ImageDraw
print('aggdraw version', aggdraw.__version__)
# aggdraw version 1.3.12 -- on aiohttp
# aggdraw version 1.3.16 -- in conda
# WARN `USE_AGGDRAW = True` causes the kernel to crash
USE_AGGDRAW = True
img = Image.new("RGB", (256, 256), "white")
if USE_AGGDRAW:
agg_draw = aggdraw.Draw(img)
else:
draw = ImageDraw.Draw(img)
# Diagonal line
p1 = (0,0)
p2 = (255,255)
if USE_AGGDRAW:
pen = aggdraw.Pen(color=(255,0,0), width=10, opacity=127)
agg_draw.line((p1[0], p1[1], p2[0], p2[1]), pen)
else:
draw.line([p1, p2], fill="red", width=10)
if USE_AGGDRAW:
agg_draw.flush()
display(img)
|
Looks like its caused by pytroll/aggdraw#58 Basically trying to inspect the details of the pen variable causes the crash. |
You're right. I just enabled debugging in Jupyter (which I had to do twice), and then, when running the cell, the kernel crashes. Thank you for your help and my apologies for not having checked this. |
No need to apologise, that’s why we ask these questions |
Applies To
What happened?
After installing aggdraw in a conda environment via
conda install -c conda-forge aggdraw
I had the following issue:I ran this cell
and after a very short time the kernel died. Same happens when I use
agg_draw = aggdraw.Draw(pil_image)
.The result was
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click [here](https://aka.ms/vscodeJupyterKernelCrash) for more info. View Jupyter [log](command:jupyter.viewOutput) for further details.
It is possible to use the cell for complex drawing and a following cell to print some text even after using
time.sleep(5)
, but sooner or later the message of the crashed kernel comes up and then it's no longer possible to re-run the notebook.Clicking "Restart" hangs up the restarting task, it stays at "Restarting Kernel: Python 3.11". I then need to remove the kernel via the web ui because the small "Restarting Kernel" notification offers no way to abort this.
VS Code is running locally on Windows (192.168.30.41), the Jupyter instance is running on a Linux server (192.168.30.25), to which VS Code is also connected via the SSH Extension (Visual Studio Code Remote).
miniconda got installed around 3 days ago.
VS Code Version
Version: 1.81.1 (user setup) Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621
Jupyter Extension Version
v2023.7.1002162226
Jupyter logs
Coding Language and Runtime Version
Python 3.11.4 (main, Jul 5 2023, 13:45:01) [GCC 11.2.0] on linux
Language Extension Version (if applicable)
Python v2023.14.0
Anaconda Version (if applicable)
conda 23.5.2 (miniconda latest, Python 3.11)
Running Jupyter locally or remotely?
Remote
The text was updated successfully, but these errors were encountered: