setup.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/env python3
  2. """
  3. InnoCore AI - Simple Setup Script
  4. """
  5. import subprocess
  6. import sys
  7. from pathlib import Path
  8. def main():
  9. print("InnoCore AI - Quick Setup")
  10. print("=" * 30)
  11. # Install basic dependencies without version conflicts
  12. basic_deps = [
  13. "fastapi",
  14. "uvicorn[standard]",
  15. "python-multipart",
  16. "python-dotenv"
  17. ]
  18. print("Installing basic dependencies...")
  19. for dep in basic_deps:
  20. try:
  21. subprocess.check_call([sys.executable, "-m", "pip", "install", dep])
  22. print(f"[OK] {dep}")
  23. except subprocess.CalledProcessError:
  24. print(f"[SKIP] {dep} (may already exist)")
  25. # Create .env file
  26. env_file = Path(".env")
  27. if not env_file.exists():
  28. env_content = """# InnoCore AI Configuration
  29. OPENAI_API_KEY=your_openai_api_key_here
  30. DATABASE_URL=sqlite:///./innocore.db
  31. SECRET_KEY=your_secret_key_here_change_this_in_production
  32. DEBUG=True
  33. """
  34. env_file.write_text(env_content)
  35. print("[OK] .env file created")
  36. else:
  37. print("[OK] .env file exists")
  38. # Create directories
  39. Path("data").mkdir(exist_ok=True)
  40. Path("logs").mkdir(exist_ok=True)
  41. print("[OK] Directories created")
  42. print("\n[SUCCESS] Setup completed!")
  43. print("Next steps:")
  44. print("1. Edit .env file and add your OpenAI API key")
  45. print("2. Run: python run.py")
  46. print("3. Open: http://localhost:8000")
  47. if __name__ == "__main__":
  48. main()