Skip to content

Instantly share code, notes, and snippets.

@0scvr
Created October 20, 2021 15:46
Show Gist options
  • Save 0scvr/06daec38c43f340347a02f84827ec90c to your computer and use it in GitHub Desktop.
Save 0scvr/06daec38c43f340347a02f84827ec90c to your computer and use it in GitHub Desktop.
Python venv commands
# create a virtual environment named env by convention
python3 -m venv env
# make sure to add env/ (or whatever you named your virtual environment) to your .gitignore file
# use the virtual environment
source env/bin/activate
# save dependencies to requirements.txt file
pip freeze > requirements.txt
# exit the virtual environment
deactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment