resolve flask[async] import on first run

This commit is contained in:
erew123 authored and GitHub committed 2024-09-27 22:05:30 +01:00
1 parent be392cee00
commit 5e12e4ae24
1 file changed
+3 -1
+3 -1
View File
@@ -71,11 +71,13 @@ def ensure_flask_dependencies():
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", "flask[async]"])
print("Flask async support installed successfully.")
importlib.reload(flask)
import flask
importlib.reload(flask) # Reload the module to ensure fresh state after install
except subprocess.CalledProcessError as e:
print(f"Failed to install Flask async support. Error: {e}")
print("Please run 'pip install flask[async]' manually.")
sys.exit(1)
# Check for Flask-CORS
try:
import flask_cors