-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
108 lines (88 loc) · 3 KB
/
Copy pathsetup.bat
File metadata and controls
108 lines (88 loc) · 3 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
103
104
105
106
107
108
@echo off
setlocal enabledelayedexpansion
:: Set UTF-8 encoding
chcp 65001 > nul
:: Change to the script's directory
cd /d "%~dp0"
:: Check for necessary folders
if not exist "portable_python" mkdir portable_python
if not exist "venv" mkdir venv
:: Download portable Python if it doesn't exist
if not exist "portable_python\python.exe" (
echo Downloading portable Python...
curl -L "https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip" -o python.zip
if %errorlevel% neq 0 (
echo Error downloading Python. Check your internet connection and try again.
pause
exit /b 1
)
echo Extracting Python...
tar -xf python.zip -C portable_python
if %errorlevel% neq 0 (
echo Error extracting Python. Please install tar or extract the zip file manually.
pause
exit /b 1
)
del python.zip
)
:: Verify Python installation
if not exist "portable_python\python.exe" (
echo Error: python.exe not found in the portable_python folder.
echo Please extract the Python zip file manually to the portable_python folder.
pause
exit /b 1
)
:: Modify python310._pth file
echo python310.zip> portable_python\python310._pth
echo .>> portable_python\python310._pth
echo import site>> portable_python\python310._pth
:: Download get-pip.py if it doesn't exist
if not exist "get-pip.py" (
echo Downloading get-pip.py...
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
)
:: Install pip
portable_python\python.exe get-pip.py
:: Add Scripts to PATH temporarily
set PATH=%cd%\portable_python;%cd%\portable_python\Scripts;%PATH%
:: Install virtualenv
portable_python\python.exe -m pip install virtualenv
:: Create virtual environment using virtualenv
echo Creating virtual environment...
portable_python\python.exe -m virtualenv venv
if %errorlevel% neq 0 (
echo Error creating virtual environment.
pause
exit /b 1
)
:: Activate virtual environment
call venv\Scripts\activate.bat
:: Upgrade pip in virtual environment
python -m pip install --upgrade pip
:: Check for requirements.txt
if not exist "requirements.txt" (
echo Error: requirements.txt file not found in the current directory.
echo Current directory: %CD%
echo Contents of current directory:
dir
pause
exit /b 1
)
:: Install dependencies
pip install -r requirements.txt
:: Verify installation of key packages
python -c "import dotenv; import openai; import numpy; import sounddevice; import PyQt6" || (
echo Error: Some required packages are not installed correctly.
echo Please check your internet connection and try running setup.bat again.
pause
exit /b 1
)
:: Create .env file if it doesn't exist
if not exist ".env" (
echo OPENAI_API_KEY=your_api_key_here > .env
)
start "" "https://vb-audio.com/Cable/"
echo Installation complete. Please download and install VB-Audio Virtual Cable from https://vb-audio.com/Cable/
echo Then edit the .env file to add your OpenAI API key.
echo To run the program, use interview_assistant.bat
pause