Spaces:
Sleeping
Sleeping
File size: 1,456 Bytes
b610d23 |
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
#!/usr/bin/env python3
"""
Launch script for NASA Solar Image Downloader Web Interface
"""
import sys
import subprocess
from pathlib import Path
def install_requirements():
"""Install required packages."""
try:
print("π¦ Installing required packages...")
subprocess.run([sys.executable, '-m', 'pip', 'install', '-r', 'requirements_gradio.txt'], check=True)
print("β
Packages installed successfully!")
return True
except subprocess.CalledProcessError as e:
print(f"β Failed to install packages: {e}")
return False
def main():
"""Main launcher."""
print("π NASA Solar Image Downloader - Web Interface Launcher")
print("=" * 60)
# Check if gradio is installed
try:
import gradio
print("β
Gradio is available")
except ImportError:
print("β οΈ Gradio not found. Installing requirements...")
if not install_requirements():
print("β Failed to install requirements. Please install manually:")
print(" pip install -r requirements_gradio.txt")
return
# Launch the application
try:
from gradio_app import main as gradio_main
gradio_main()
except Exception as e:
print(f"β Error launching application: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
main() |