ELI5: Python Virtual Env

python -V
brew install pyenv
pyenv install 3.8.2
pyenv local 3.8.2

# should return 3.8.2
python -V

mkdir pydo
python -m venv venv380
source venv380/bin/activate
#ready for devpython -m venv env
source env/bin/activate
pip install -r requirements.txt && python setup.py install
pyenv rehash # rehash pyenv shims (run this after installing executables)
# to run a test
pytest path_to_test_file -k 'run_this_test_case_only'
alias venv='python -m venv env'
alias actv='source env/bin/activate'
alias dctv=deactivate
alias pyclean='find . -type f -name '\''*.py[co]'\'' -delete -o -type d -name __pycache__ -delete -o -type f -name '\''.coverage.*'\'' -delete'

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to use Multiple Conditions with 3Commas Bots

Steering Kubernetes Applications with Helm

Can you Build a CPU?

Cloud Infrastructure

Hadoop MapReduce and Spark Framework

A Lodestar for Eth2

SSH.. first thing a web developer should know

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Natarajan Santhosh

Natarajan Santhosh

More from Medium

Build your own website with Flask, Docker and Heroku for peanuts

(almost) Daily Python Quick-Tips #15

An introduction to asyncio in python

Setting-up Airflow on Windows 10 without Docker