|
1 | 1 | # Streamlit Installation and Usage Guide |
2 | 2 |
|
3 | | -This guide explains how to install Streamlit on both Linux and Windows machines and how to run a basic Streamlit program. |
| 3 | +This guide explains how to install Streamlit on both Linux and Windows machines and how to run a Streamlit program. |
4 | 4 |
|
5 | 5 | --- |
6 | 6 |
|
@@ -60,33 +60,73 @@ This guide explains how to install Streamlit on both Linux and Windows machines |
60 | 60 |
|
61 | 61 | ## 4. Running a Streamlit Program |
62 | 62 |
|
63 | | -1. **Create a Streamlit Python script** |
| 63 | +### Instructions to Run `streamlit_1.py` and `streamlit_2.py` |
64 | 64 |
|
65 | | - Example: `app.py` |
66 | | - ```python |
67 | | - import streamlit as st |
| 65 | +### Running `streamlit_1.py` |
68 | 66 |
|
69 | | - st.title('Hello, Streamlit!') |
70 | | - st.write('Welcome to your first Streamlit app!') |
71 | | - ``` |
| 67 | +1. **Create and activate a virtual environment:** |
| 68 | + ```sh |
| 69 | + python3 -m venv venv |
| 70 | + source venv/bin/activate |
| 71 | + ``` |
72 | 72 |
|
73 | | -2. **Run the Streamlit app** |
| 73 | +2. **Install required package:** |
| 74 | + ```sh |
| 75 | + pip3 install plotly |
| 76 | + ``` |
74 | 77 |
|
75 | | - On both Linux and Windows, use the following command in your terminal: |
76 | | - ```bash |
77 | | - streamlit run app.py |
78 | | - ``` |
| 78 | +3. **Run the script (example):** |
| 79 | + ```sh |
| 80 | + python streamlit_1.py |
| 81 | + ``` |
79 | 82 |
|
80 | | -3. **Access the app** |
| 83 | +4. **Deactivate the virtual environment:** |
| 84 | + ```sh |
| 85 | + deactivate |
| 86 | + ``` |
81 | 87 |
|
82 | | - After running the command, Streamlit will provide a local URL (usually `http://localhost:8501`) that you can open in your browser. |
| 88 | +5. **(Optional) Remove the virtual environment files:** |
| 89 | + ```sh |
| 90 | + rm -rf venv |
| 91 | + ``` |
83 | 92 |
|
84 | 93 | --- |
85 | 94 |
|
86 | | -## 5. Additional Resources |
| 95 | +### Running `streamlit_2.py` |
| 96 | + |
| 97 | +1. **Create and activate a virtual environment:** |
| 98 | + ```sh |
| 99 | + python3 -m venv venv |
| 100 | + source venv/bin/activate |
| 101 | + ``` |
| 102 | + |
| 103 | +2. **Install required packages:** |
| 104 | + ```sh |
| 105 | + pip3 install streamlit |
| 106 | + pip3 install plotly |
| 107 | + pip3 install statsmodels |
| 108 | + ``` |
| 109 | + |
| 110 | +3. **Run the script (example):** |
| 111 | + ```sh |
| 112 | + python streamlit_2.py |
| 113 | + ``` |
| 114 | + |
| 115 | +4. **Deactivate the virtual environment:** |
| 116 | + ```sh |
| 117 | + deactivate |
| 118 | + ``` |
| 119 | + |
| 120 | +5. **(Optional) Remove the virtual environment files:** |
| 121 | + ```sh |
| 122 | + rm -rf venv |
| 123 | + ``` |
| 124 | + |
| 125 | +--- |
87 | 126 |
|
88 | | -- [Streamlit Documentation](https://docs.streamlit.io/) |
89 | | -- [Streamlit Community Forum](https://discuss.streamlit.io/) |
| 127 | +**Note:** |
| 128 | +- Ensure you are in the correct directory before running these commands. |
| 129 | +- Removing the `venv` folder will delete the virtual environment and all installed packages. |
90 | 130 |
|
91 | 131 | --- |
92 | 132 |
|
|
0 commit comments