Skip to content

Instantly share code, notes, and snippets.

@iamsarthakjoshi
Created January 27, 2021 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamsarthakjoshi/903fb9669dd5454e35f468379c9e6e7b to your computer and use it in GitHub Desktop.
Save iamsarthakjoshi/903fb9669dd5454e35f468379c9e6e7b to your computer and use it in GitHub Desktop.
Ways to manage python version and use venv on them.

First way: My personal peference:

pyenv to manage my python version.

pyenv install 3.7.3
pyenv local 3.7.3

Check your python version:

$ python --version
Python 3.7.3

Create the virtual environment with venv:

python -m venv venv

Then activate the Virtual Environment:

source venv/bin/activate

Check your python version:

$ python --version
Python 3.7.3

You may need to remove the previous virtual environment

rm -rf venv/bin

Real Python's way: [virtual-environments-and-pyenv](https://realpython.com/intro-to-pyenv/#virtual-environments-and-pyenv)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment