harsh
harsh

Reputation: 33

AxiosError: Request failed with status code 403 in streamlit

I am getting this error "AxiosError: Request failed with status code 403" while uploading image on streamlit app. this is my code screenshot of error

import streamlit as st
from PIL import Image

# Title
st.title('Image Viewer')

    #Upload an image
uploaded_image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png", "webp"])

    # Check the type of the uploaded image
if uploaded_image is not None:
        # Open the image using PIL
        image = Image.open(uploaded_image)
        # Display the image
        st.image(image, use_column_width=True)

I checked all the necessary packages is installed along with tried running same project in newly created environment but it didn't solve anything.

Upvotes: 3

Views: 6993

Answers (2)

Muhammad Faisal Iqbal
Muhammad Faisal Iqbal

Reputation: 11

Some versions of Python do not fully support the dependencies of Streamlit.

I fixed my issue by installing Python version=3.12.4 and Streamlit version=1.37.1, and all the dependencies now work smoothly.

Upvotes: 1

Neelavdeep Bhagabati
Neelavdeep Bhagabati

Reputation: 106

If you are running it locally try:

streamlit run app.py --server.enableXsrfProtection false

Upvotes: 9

Related Questions