-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
30 lines (24 loc) · 958 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
"""
PopulPy - Entry point for Streamlit application
This file serves as the main entry point to run the Streamlit application.
It ensures that Python can correctly import modules from the project.
"""
import os
import sys
import subprocess
def main():
"""
Run the Streamlit application with the correct Python path configuration
"""
# Get absolute path to the project root directory
project_root = os.path.abspath(os.path.dirname(__file__))
# Get path to the actual Streamlit app
streamlit_app_path = os.path.join(project_root, "src", "ui", "streamlit_app.py")
# Set PYTHONPATH environment variable to include the project root
env = os.environ.copy()
env["PYTHONPATH"] = f"{project_root}:{env.get('PYTHONPATH', '')}"
# Run the Streamlit app with proper environment
subprocess.run(["streamlit", "run", streamlit_app_path], env=env)
if __name__ == "__main__":
main()