Streamlit python script to exe using auto-py-to-exe

Viewed 28

I have tried to convert my python script to exe using auto-py-to-exe got exe but while running the file found the following error due to streamlit. Is it is possible to convert python script with streamlit code to exe. without deploying it as streamlit app. I need to run the exe, my streamlit need to open in local server

Traceback (most recent call last):
File "importlib_metadata\__init__.py", line 564, in from_name
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 1, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "streamlit\__init__.py", line 56, in <module>
File "importlib_metadata\__init__.py", line 1015, in version
File "importlib_metadata\__init__.py", line 988, in distribution
File "importlib_metadata\__init__.py", line 566, in from_name
importlib_metadata.PackageNotFoundError: No package metadata was found for streamlit





import streamlit as st
import pandas as pd


uploaded_file=""
page1=True

def df_concat(uploaded_file:list):
    try:
        l=[]
        for i in uploaded_file:
            df = pd.read_excel(i)
            l.append(df)
        df3=pd.concat(l,axis=0)
        return df3
    except:
        return pd.DataFrame()

st.header("Excel file appending")

uploaded_file=st.file_uploader("Upload your input excel files             ",accept_multiple_files=True,type="xlsx")

if len(uploaded_file)>1:
    submit=st.button("Submit")
    with st.spinner('Loading...'):
        if submit:
            df3=df_concat(uploaded_file)
            if not df3.empty:
                #st.dataframe(df3.head(1)) 
                df3.to_excel("concat_output.xlsx")
                st.success("Excel downloaded ! ✅") 
            else:
                st.error("Error")
else:
    #st.write("Select Files")
    st.warning('Select files', icon="⚠️")
0 Answers
Related