Created
October 5, 2021 01:35
-
-
Save fahofmeister/aab4c972dd7212597fd878ec309d4d9f to your computer and use it in GitHub Desktop.
Create a virtual environment for Python development in Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Batch script to setup a virtual development environment | |
@echo off | |
:: Variables | |
set venv_folder=.\.venv | |
:: Creating virtual environment | |
echo Creating virtual environment | |
echo. | |
if exist %venv_folder%\ ( | |
echo Virtual environment already exists | |
echo. | |
goto activate | |
) else ( | |
python -m venv "%venv_folder%" | |
) | |
:: Activating virtual environment | |
:activate | |
echo Activating virtual environment | |
echo. | |
call %venv_folder%\Scripts\activate.bat | |
:: Update pip | |
echo Updating pip in virtual environment | |
echo. | |
python.exe -m pip install --upgrade pip | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment