Closed SudhanshuBlaze closed 10 months ago
Ah yes. You'll need to use a newer version of python to use this package. 3.10 definitely works fine.
I'll update the pyproject.toml.
Yup upgrading to python 3.10 worked
Older version of Python could avoid this error by using pip install eval_type_backport
, and rewriting image_variants
and
image_tuple
image_variants = Union[_Image.Image, np.ndarray, str, Path, None]
image_tuple = Union[
Tuple[str, str],
Tuple[_Image.Image, _Image.Image],
Tuple[np.ndarray, np.ndarray],
None
]
Thanks
On Mon, 5 Feb 2024, 4:39 am LWQ2EDU, @.***> wrote:
older version of Python could avoid this error by using pip install eval_type_backport, and rewriting image_variants and 'image_tuple'
image_variants = Union[_Image.Image, np.ndarray, str, Path, None] image_tuple = Union[ Tuple[str, str], Tuple[_Image.Image, _Image.Image], Tuple[np.ndarray, np.ndarray], None ]
— Reply to this email directly, view it on GitHub https://github.com/pngwn/gradio-imageslider/issues/8#issuecomment-1926176317, or unsubscribe https://github.com/notifications/unsubscribe-auth/APG3R4HU6WY6RSTCXBQYRX3YSBH65AVCNFSM6AAAAABCORTKV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRWGE3TMMZRG4 . You are receiving this because you modified the open/close state.Message ID: @.***>
Older version of Python could avoid this error by using
pip install eval_type_backport
, and rewritingimage_variants
andimage_tuple
image_variants = Union[_Image.Image, np.ndarray, str, Path, None] image_tuple = Union[ Tuple[str, str], Tuple[_Image.Image, _Image.Image], Tuple[np.ndarray, np.ndarray], None ]
directly copying these lines to main.py seems to not work. I cannot figure out why? how to use the library (eval_type_backport)? I also found that the gradio_imageslider0.0.18 have "from __future import annotation " statement, so theoretically the error should not happen when using 0.0.18, but it did occur. but if we install the gradio_imageslider==0.0.17(rather than the current release 0.0.18), the problem can be solved.
Code
Error