我在 Streamlit 应用程序上上传图像时收到此错误 “AxiosError:请求失败,状态代码为 403”。 这是我的代码
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)
我检查了所有必需的软件包是否已安装,并尝试在新创建的环境中运行相同的项目,但没有解决任何问题。
如果您在本地运行它,请尝试:
streamlit run app.py --server.enableXsrfProtection false