Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nprasad2077/d3c04617e3fba6c520dd65bd64e5d8a0 to your computer and use it in GitHub Desktop.
Save nprasad2077/d3c04617e3fba6c520dd65bd64e5d8a0 to your computer and use it in GitHub Desktop.
VENV settings python
# πŸ‘‡οΈ optionally store installed packages in a file
pip freeze > requirements.txt
# πŸ‘‡οΈ deactivate
deactivate
# πŸ‘‡οΈ Remove the old virtual environment folder: macOS and Linux
rm -rf venv
# πŸ‘‡οΈ Remove the old virtual environment folder: Windows
rd /s /q "venv"
# πŸ‘‡οΈ initialize a new virtual environment
python -m venv venv
# πŸ‘‡οΈ activate on Unix or MacOS
source venv/bin/activate
# πŸ‘‡οΈ activate on Windows (cmd.exe)
venv\Scripts\activate.bat
# πŸ‘‡οΈ activate on Windows (PowerShell)
venv\Scripts\Activate.ps1
# πŸ‘‡οΈ upgrade your pip version
pip install --upgrade pip
# πŸ‘‡οΈ install the modules in your requirements.txt file
pip install -r requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment