Skip to content

Instantly share code, notes, and snippets.

@khangvan
Created January 27, 2020 07:10
Show Gist options
  • Save khangvan/09fa852459a412c0404b29bfad226836 to your computer and use it in GitHub Desktop.
Save khangvan/09fa852459a412c0404b29bfad226836 to your computer and use it in GitHub Desktop.
python3_virtualenv_venv_operation
#check python version
python -V
# install
pip3 install virtualenv
# create env
python3 -m venv base
# activate
source base/bin/activate
# deativate
deactivate
#packing requirements
pip freeze > requirements.txt
#delete
rm -rf venv
# crontab
crontab -e
* * * * * /path/to/venv/bin/python /path/to/code.py
# new env install packing
pip install -r requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment