Skip to content
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

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

Closed
1 task
srt7509 opened this issue Aug 16, 2024 · 10 comments · Fixed by #19977
Closed
1 task

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

srt7509 opened this issue Aug 16, 2024 · 10 comments · Fixed by #19977
Labels
bug [core label] python Python programming language support repl repl, jupyter, notebooks, etc

Comments

@srt7509
Copy link

srt7509 commented Aug 16, 2024

Check for existing issues

  • Completed

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
@srt7509 srt7509 added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Aug 16, 2024
@notpeter notpeter added python Python programming language support repl repl, jupyter, notebooks, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Aug 22, 2024
@notpeter
Copy link
Member

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

@rgbkrk
Copy link
Member

rgbkrk commented Aug 23, 2024

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
Copy link
Author

srt7509 commented Aug 28, 2024

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
Copy link
Author

srt7509 commented Aug 28, 2024

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.

@rgbkrk rgbkrk closed this as completed Aug 28, 2024
@srt7509
Copy link
Author

srt7509 commented Sep 2, 2024

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
Copy link

cthed2 commented Sep 19, 2024

I have a similar error in:

@notpeter
Copy link
Member

notpeter commented Sep 19, 2024

@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
Copy link
Author

srt7509 commented Oct 5, 2024

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

@jamesacodgers
Copy link

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

@SweetestRug
Copy link

I am also having the same issue with Zed 0.157.5

@rgbkrk rgbkrk closed this as completed in 7ce131a Oct 30, 2024
notpeter pushed a commit that referenced this issue Oct 31, 2024
…9977)

Closes #17956
Closes #16330

This fix is for both REPL (released) and notebook (unreleased)

<img width="1210" alt="image"
src="https://github.com/user-attachments/assets/bd046f0f-3ad1-4c25-b3cb-114e008c2a69">

Release Notes:

- Fixed image support in REPL for certain versions of matplotlib that
included preceding and/or trailing whitespace in the base64 image data
notpeter pushed a commit that referenced this issue Oct 31, 2024
…9977)

Closes #17956
Closes #16330

This fix is for both REPL (released) and notebook (unreleased)

<img width="1210" alt="image"
src="https://github.com/user-attachments/assets/bd046f0f-3ad1-4c25-b3cb-114e008c2a69">

Release Notes:

- Fixed image support in REPL for certain versions of matplotlib that
included preceding and/or trailing whitespace in the base64 image data
CharlesChen0823 pushed a commit to CharlesChen0823/zed that referenced this issue Nov 18, 2024
…d-industries#19977)

Closes zed-industries#17956
Closes zed-industries#16330

This fix is for both REPL (released) and notebook (unreleased)

<img width="1210" alt="image"
src="https://github.com/user-attachments/assets/bd046f0f-3ad1-4c25-b3cb-114e008c2a69">

Release Notes:

- Fixed image support in REPL for certain versions of matplotlib that
included preceding and/or trailing whitespace in the base64 image data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] python Python programming language support repl repl, jupyter, notebooks, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants