-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
22 lines (22 loc) · 1 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
if __name__ == '__main__':
try:
import os
os.system('uvicorn api.main:app --reload --port 5500')
except KeyboardInterrupt:
print("Session ended, run python main.py to run the app again")
except ImportError:
os.system('python -m pip install -r requirements.txt')
except Exception:
print("""
Error: There is unexpected error.
Please check the following issues:
1. Error: uvicorn is not installed:
Please install uvicorn with:
python -m pip install uvicorn
2. Error: there is conflict with another program or port:
Check the running apps, or check the port. Maybe port 5500 is used by another running process
3. Error: uvicorn conflicts:
run python -m pip install uvicorn --upgrade
or run python -m pip install uvicorn --upgrade --user
or run python -m pip install uvicorn --upgrade --user --force-reinstall
""")