-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVenvCreate.bat
More file actions
26 lines (22 loc) · 776 Bytes
/
VenvCreate.bat
File metadata and controls
26 lines (22 loc) · 776 Bytes
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
pip install virtualenv
python -m venv venv
call venv/Scripts/activate.bat
set "filename=isvenv.py"
echo ^>^>^> Creating Python file: %filename%
echo import os >> %filename%
echo running_in_virtualenv = "VIRTUAL_ENV" in os.environ >> %filename%
echo print(f'venv working: {running_in_virtualenv}') >> %filename%
echo ^>^>^> Python file created: %filename%
python isvenv.py > temp.txt
set /p venv_working=<temp.txt
del temp.txt
del isvenv.py
echo %venv_working%
if "%venv_working%"=="venv working: True" (
@REM NOTE: only uncomment the line below if you have a requirements.txt file
echo venv is working properly. Installing requirements...
@REM pip install -r requirements.txt
) else (
echo venv is not working properly. Not installing requirements.
)
pause