Spaces:
Sleeping
Sleeping
File size: 1,351 Bytes
c70152b |
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 |
REM Check if Python 3.11 is installed
REM Replace "3.x" with the desired Python version (e.g., 3.8, 3.9, etc.)
set PythonVersion=3.9.0
set "PythonVersionMain=%PythonVersion:~0,3%"
set "PythonVersionWithoutDots=%PythonVersionMain:.=%"
REM Replace "myenv" with the desired name for the virtual environment
echo %PythonVersionWithoutDots%
set EnvName= myenvEEW
if exist %LocalAppData%\Programs\Python\Python39\python.exe (
%LocalAppData%\Programs\Python\Python39\python -m venv %EnvName%
) else (
echo Python 3.9 not found in user app folder.. searching fo install for all users
if exist "%ProgramFiles%\Programs\Python39\python.exe" (
%ProgramFiles%\Programs\Python39\python -m venv %EnvName%
) else (
echo Python 3.11 is not installed. Installing Python 3.9...
REM Download and install Python 3.11.0 in the current directory
curl -o python_installer.exe https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe
python_installer.exe \silent InstallAllUsers=0 PrependPath=0 Include_test=0
del python_installer.exe
%LocalAppData%\Programs\Python\Python39\Python -m venv %EnvName%
)
)
REM Activate the virtual environment
call myenvEEW\Scripts\activate
REM Install required packages
pip install -r requirements.txt
REM Deactivate the virtual environment
deactivate
REM This will pause the Command Prompt
call cmd
|