-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
102 lines (88 loc) · 2.45 KB
/
setup.bat
File metadata and controls
102 lines (88 loc) · 2.45 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
@echo off
echo 🚀 CodedSwitch AI Code Translator - Setup Script
echo ================================================
REM Check if Python is installed
python --version >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo ❌ Python not found! Please install Python 3.8+ and add it to PATH
pause
exit /b 1
)
echo ✅ Python found
python --version
REM Create virtual environment if it doesn't exist
if not exist ".venv" (
echo 📦 Creating virtual environment...
python -m venv .venv
if %ERRORLEVEL% neq 0 (
echo ❌ Failed to create virtual environment
pause
exit /b 1
)
) else (
echo 📦 Virtual environment already exists
)
REM Activate virtual environment
echo 🔌 Activating virtual environment...
call .venv\Scripts\activate.bat
REM Upgrade pip
echo 📥 Upgrading pip...
python -m pip install --upgrade pip
REM Install requirements
echo 📋 Installing dependencies...
if exist "requirements.txt" (
python -m pip install -r requirements.txt
) else (
echo ⚠️ requirements.txt not found, installing core dependencies...
python -m pip install ttkbootstrap>=1.10.1
python -m pip install google-generativeai>=0.3.0
python -m pip install grpcio>=1.66.0
python -m pip install requests>=2.31.0
python -m pip install python-dotenv>=1.0.0
python -m pip install typing_extensions>=4.0.0
python -m pip install pywin32>=306
)
REM Test installation
echo 🧪 Testing installation...
python -c "
import sys
print(f'Python version: {sys.version}')
try:
import tkinter
print('✅ tkinter: OK')
except ImportError as e:
print(f'❌ tkinter: {e}')
try:
import ttkbootstrap
print('✅ ttkbootstrap: OK')
except ImportError as e:
print(f'❌ ttkbootstrap: {e}')
try:
import google.generativeai as genai
print('✅ google-generativeai: OK')
except ImportError as e:
print(f'❌ google-generativeai: {e}')
try:
import requests
print('✅ requests: OK')
except ImportError as e:
print(f'❌ requests: {e}')
try:
import dotenv
print('✅ python-dotenv: OK')
except ImportError as e:
print(f'❌ python-dotenv: {e}')
print('🎯 Core dependency test complete!')
"
echo.
echo ✅ Setup completed successfully!
echo.
echo To run the application:
echo 1. Activate the virtual environment: .venv\Scripts\activate.bat
echo 2. Run the application: python main.py
echo.
echo Or use: test_api.bat
echo.
echo 📝 Make sure your API key is set in the .env file!
echo.
pause