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

can not write_image #237

Open
YUWEN opened this issue Dec 16, 2024 · 2 comments
Open

can not write_image #237

YUWEN opened this issue Dec 16, 2024 · 2 comments
Assignees
Labels

Comments

@YUWEN
Copy link

YUWEN commented Dec 16, 2024

python=3.8.10
plotly=5.23.0
keleido=0.2.1
i can preview the image on website(127.0.0.1:*)
but fig.write_image() will occur errors below:

fig.write_image(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\plotly\basedatatypes.py", line 3835, in write_image
return pio.write_image(self, *args, **kwargs)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\plotly\io_kaleido.py", line 266, in write_image
img_data = to_image(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\plotly\io_kaleido.py", line 143, in to_image
img_bytes = scope.transform(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\kaleido\scopes\plotly.py", line 153, in transform
response = self._perform_transform(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\kaleido\scopes\base.py", line 293, in _perform_transform
self._ensure_kaleido()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\kaleido\scopes\base.py", line 192, in _ensure_kaleido
startup_response_string = self._proc.stdout.readline().decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

Image

@ayjayt
Copy link
Collaborator

ayjayt commented Dec 16, 2024

So this version of Kaleido is about to be deprecated, but that said, it is such a strange error, readline() AFAIK has always, and should always return a binary object, not a string. @YUWEN I will ping you in a day or two when the new version is released if you'd like to try that. Thanks!

@ayjayt ayjayt self-assigned this Dec 16, 2024
@ayjayt ayjayt added the active label Dec 16, 2024
@YUWEN
Copy link
Author

YUWEN commented Dec 17, 2024

So this version of Kaleido is about to be deprecated, but that said, it is such a strange error, readline() AFAIK has always, and should always return a binary object, not a string. @YUWEN I will ping you in a day or two when the new version is released if you'd like to try that. Thanks!

Thanks a lot !!! hope to get good news

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants