diff --git a/win_exe_with_embeddable_python.md b/win_exe_with_embeddable_python.md index c6e1a3fa..009b0005 100644 --- a/win_exe_with_embeddable_python.md +++ b/win_exe_with_embeddable_python.md @@ -1,9 +1,9 @@ -# Creating a Windows Executable of a Streamlit App with Embeddable Python +## 🚀 Creating a Windows Executable of a Streamlit App with Embeddable Python -To create an executable for Streamlit app on Windows, we'll use an embeddable version of Python.
+To create an executable for your Streamlit app on Windows, we'll use an embeddable version of Python.
Here's a step-by-step guide: -### Download and Extract Python Embeddable Version +### 📥 Download and Extract Python Embeddable Version 1. Download a suitable Python embeddable version. For example, let's download Python 3.11.9: @@ -17,7 +17,7 @@ Here's a step-by-step guide: unzip python-3.11.9-embed-amd64.zip ``` -### Install pip +### 🛠 Install pip 1. Download `get-pip.py`: @@ -31,7 +31,7 @@ Here's a step-by-step guide: ./python-3.11.9-embed-amd64/python --no-warn-script-location ``` -### Configure Python Environment +### ⚙ Configure Python Environment 1. Uncomment 'import site' in the `python311._pth` file: @@ -44,7 +44,7 @@ Here's a step-by-step guide: sed -i 's/^# import site/import site/' python-3.11.9-embed-amd64/python311._pth ``` -### Install Required Packages +### 📦 Install Required Packages Install all required packages from `requirements.txt`: @@ -52,7 +52,7 @@ Install all required packages from `requirements.txt`: ./python-3.11.9-embed-amd64/python -m pip install -r requirements.txt --no-warn-script-location ``` -### Copy App Files +### 📂 Copy App Files and Create `run_app.bat` File 1. Create a folder for your Streamlit app: @@ -64,20 +64,19 @@ Install all required packages from `requirements.txt`: ```bash # Copy Python environment and app files - cp -r python-3.11.9-embed-amd64 streamlit_exe \ - && cp -r src ../streamlit_exe \ - && cp -r pages ../streamlit_exe \ - && cp -r .streamlit ../streamlit_exe \ - && cp -r example_data ../streamlit_exe \ - && cp app.py ../streamlit_exe + cp -r python-3.11.9-embed-amd64 streamlit_exe + cp -r src pages .streamlit example_data app.py ../streamlit_exe ``` - -### Create a Clickable Shortcut - -Create a `run_app.bat` file to make running the app easier: - -```batch -@echo off -.\python-3.11.9-embed-amd64\python -m streamlit run app.py local -``` + +3. Create a Clickable Shortcut + + Create a `run_app.bat` file to make running the app easier: + + ```batch + @echo off + .\python-3.11.9-embed-amd64\python -m streamlit run app.py local + ``` +##### 🚀 After successfully completing all these steps, the Streamlit app will be available by running the run_app.bat file. +> [!NOTE] +You can still change the configuration of Streamlit app with .streamlit/config.toml file, e.g., provide a different port, change upload size, etc.