#1053318 python3-plotly: imshow displays no data

#1053318#5
Date:
2023-10-01 17:13:32 UTC
From:
To:
Dear Maintainer,

I recently updated from bullseye to bookworm and I've not been able to get
plotly's imshow to work since. First, there's a version mismatch in stable -
using imshow results in the following error:

AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in
existing code, use `bool` by itself. Doing this will not modify any behavior
and is safe. If you specifically wanted the numpy scalar type, use `np.bool_`
here.
The aliases was originally deprecated in NumPy 1.20; for more details and
guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

plotly fixed this error in May
(https://github.com/plotly/plotly.py/issues/3403) but I guess that version has
not made it into stable yet. stable has plotly v5.4.1 and numpy v1.24.2

So then I tried the testing version (5.15.0) and ran into a different problem -
imshow displays completely blank axes. You can see this with the example code
from https://plotly.com/python/imshow/:

import plotly.express as px
import numpy as np
img_rgb = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]],
                    [[0, 255, 0], [0, 0, 255], [255, 0, 0]]
                   ], dtype=np.uint8)
fig = px.imshow(img_rgb)
fig.show()

I don't know what to do about it aside from reporting it.

Thanks very much,
Sig