""" Setup script to create required directories for OpenEnv project. Run: python setup_dirs.py """ import os from pathlib import Path def create_directories(): """Create all required directories for the project.""" # Get the project root (where this script is) project_root = Path(__file__).parent # Directories to create directories = [ "outputs", "outputs/logs", "outputs/results", "outputs/checkpoints", "outputs/visualizations", "logs", "data", "data/raw", "data/processed", "configs", ] print(f"Setting up directories in: {project_root}") print("-" * 50) for dir_path in directories: full_path = project_root / dir_path if not full_path.exists(): full_path.mkdir(parents=True, exist_ok=True) print(f"✅ Created: {dir_path}") else: print(f"✓ Already exists: {dir_path}") print("-" * 50) print("✅ Directory setup complete!") # Also create a .gitkeep file to keep empty directories in git gitkeep_path = project_root / "outputs" / ".gitkeep" if not gitkeep_path.exists(): with open(gitkeep_path, 'w') as f: f.write("# This directory is for outputs\n") print(f"✅ Created: outputs/.gitkeep") def check_environment(): """Check if environment is properly configured.""" print("\n" + "="*50) print("Environment Check") print("="*50) # Check Python version import sys print(f"Python version: {sys.version}") # Check for .env file env_file = Path(__file__).parent / ".env" if env_file.exists(): print("✅ .env file found") else: print("⚠️ .env file not found (optional)") print(" Create .env with: HF_TOKEN=your_token_here") # Check for required packages required_packages = ["openai", "requests", "fastapi", "uvicorn"] for package in required_packages: try: __import__(package) print(f"✅ {package} installed") except ImportError: print(f"❌ {package} not installed") print(f" Install with: pip install {package}") # Check openenv try: import openenv print(f"✅ openenv installed (version: {openenv.__version__ if hasattr(openenv, '__version__') else 'unknown'})") except ImportError: print("❌ openenv not installed") print(" Install with: pip install openenv") if __name__ == "__main__": create_directories() check_environment() print("\n" + "="*50) print("Next Steps:") print("="*50) print("1. Start the server: python server/app.py") print("2. Run inference: python inference.py --mode rule") print("3. Run LLM: python inference.py --mode llm") print("="*50)