我已经用python制作了一个Streamlit应用程序,在其中可以拖放gpx文件。
import streamlit as st
file = st.file_uploader("Upload a strava file (gpx)", type=["gpx"],accept_multiple_files=False)

但是,使用gpxpy包打开InMemoryUploadedFile是不可能的。给我一个KeyError: 3655
import gpxpy
gpx = gpxpy.parse(file)有人能帮我吗?
发布于 2021-04-20 14:16:28
请尝试:
import streamlit as st
import gpxpy
file = st.file_uploader("Upload a strava file (gpx)", type=["gpx"], accept_multiple_files=False)
if uploaded_file is not None:
gpx = gpxpy.parse(uploaded_file)还请确保streamlit和gpxpy都更新到最新版本,并且gpx文件未损坏
https://stackoverflow.com/questions/67037653
复制相似问题