#!/usr/bin/env python3 """ Simple launcher for PerplexityViewer that handles common issues """ import sys import os def main(): """Simple launcher with fallback options""" print("🚀 Starting PerplexityViewer...") try: # Try importing required modules import gradio as gr print(f"✅ Gradio version: {gr.__version__}") # Import the app from app import demo # Launch with minimal configuration print("🌐 Launching app at http://localhost:7860") demo.launch() except ImportError as e: print(f"❌ Missing dependency: {e}") print("💡 Install requirements with: pip install -r requirements.txt") sys.exit(1) except Exception as e: print(f"❌ Launch failed: {e}") print("💡 Trying alternative methods...") # Try different launch approaches try: from app import demo demo.launch(server_name="127.0.0.1", server_port=7860) except: try: from app import demo demo.launch(share=False, debug=True) except: print("❌ All launch methods failed") print("💡 Try running: python app.py directly") sys.exit(1) if __name__ == "__main__": main()