Hello streamlit community, am having some problem trying to use the st.image() to open an image saved on my local disk. below is the code
The pic fails to open when i run the script. Anyone who knows how to solve it?
Have you tried a variation of these:
If this doesn’t work, try using Pillow to handle the image before passing it to
import streamlit as st
from PIL import Image
# Open the image from the specified path
image = Image.open('c:/U/d/Desktop/logo.png')
# Display the image with a caption in Streamlit
st.image(image, caption='My logo')
using PIL worked but changing to double or forward slash didn’t
Ah great, glad it worked eventually. Happy Streamlit-ing!
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.