zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.46k stars 3.02k forks source link

Failed to load image: Invalid symbol 10, offset 19812. #16330

Closed srt7509 closed 1 week ago

srt7509 commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

It shows "Failed to load image: Invalid symbol 10, offset 19812." after I run a python program with plotting function using Zed REPL. By the way, the results are all correct except no pictures showed. 截屏2024-08-16 11 05 30

Environment

Mac OS 13.6 , Miniconda Python 3.9

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

2024-08-16T10:55:29.359898+08:00 [INFO] kernel: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.
2024-08-16T10:55:29.360055+08:00 [INFO] kernel: 
2024-08-16T10:55:29.360175+08:00 [INFO] kernel: To exit, you will have to explicitly quit this process, by either sending
2024-08-16T10:55:29.360298+08:00 [INFO] kernel: "quit" from a client, or using Ctrl-\ in UNIX-like environments.
2024-08-16T10:55:29.360422+08:00 [INFO] kernel: 
2024-08-16T10:55:29.36054+08:00 [INFO] kernel: To read more about this, see https://github.com/ipython/ipython/issues/2049
2024-08-16T10:55:29.360664+08:00 [INFO] kernel: 
2024-08-16T10:55:29.360782+08:00 [INFO] kernel: 
2024-08-16T10:55:29.360901+08:00 [INFO] kernel: To connect another client to this kernel, use:
2024-08-16T10:55:29.361024+08:00 [INFO] kernel:     --existing kernel-zed-30064771095.json
notpeter commented 2 months ago

Can you please paste your Zed version info into the issue description? cmd-shift-p and copy specs to clipboard

rgbkrk commented 2 months ago

If that error is coming up, the image crate was unable to render it. If you can reliably run that same block again with that error, it might be helpful for us to see your matplotlibrc because I haven't been able to reproduce with your code.


When I ran the code it produced a valid image though I don't have the font:

image

If I switch to Arial Unicode MS I get:

image

srt7509 commented 2 months ago

Can you please paste your Zed version info into the issue description? cmd-shift-p and copy specs to clipboard

Thanks a lot,I used Ver. 0.148.1 for learning last week, I will try it again using the latest version.

srt7509 commented 2 months ago

If that error is coming up, the image crate was unable to render it. If you can reliably run that same block again with that error, it might be helpful for us to see your matplotlibrc because I haven't been able to reproduce with your code.

When I ran the code it produced a valid image though I don't have the font:

image

If I switch to Arial Unicode MS I get:

image

Thanks. The font problems in my code was showed up when I used other editor , such as VSC, Sublime. So I guess that is not the reason. I will using the latest version Zed and test again.

srt7509 commented 2 months ago

Sorry, the bug came again. I use Zed Preview 0.151.1 for Mac (Intel).

Zed: v0.151.1 (Zed Preview) OS: macOS 13.6.0 Memory: 16 GiB Architecture: x86_64

image

My code:

import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np

x = np.random.randint(low=2, high=10, size=10) y = np.random.randint(low=2, high=10, size=10) plt.scatter(x, y)
plt.title("hi") plt.xlabel("x") plt.ylabel("y") plt.show()

cthed2 commented 1 month ago

I have a similar error in:

notpeter commented 1 month ago

@cthed2 Reported a similar error in dev (0.154.x) in #18086. Reopening here, hopefully we can find some reproduction steps.

The R code executes fine, I can't view images generated by ggplot2. Instead, I receive the following error message.

Failed to load image: Invalid symbol 10, offset 72

image

2024-09-19T11:07:07.461096-05:00 [ERROR] Error { code: HRESULT(0x80070490), message: "No se ha encontrado el elemento." }

Settings:

"jupyter": {
  "kernel_selections": {
    "r": "ark"
  }
}
srt7509 commented 1 month ago

The error still shows up in Zed Preview 0.156.0, hope you guys can fix it .

jamesacodgers commented 3 weeks ago

I'm also having a similar problem with Zed preview 0.156.1

SweetestRug commented 2 weeks ago

I am also having the same issue with Zed 0.157.5