Skip to content

Instantly share code, notes, and snippets.

@shivanshthapliyal
Last active February 22, 2021 18:07
Show Gist options
  • Save shivanshthapliyal/c16ae6c7a0abf16dd5c77b51b8e928ee to your computer and use it in GitHub Desktop.
Save shivanshthapliyal/c16ae6c7a0abf16dd5c77b51b8e928ee to your computer and use it in GitHub Desktop.

🐍🐍🐍🐍🐍🐍🐍🐍🐍

Python Essentials

🐍🐍🐍🐍🐍🐍🐍🐍🐍

Ubuntu 18.04+

Install Python3

Install Python3 Pip

sudo apt update
sudo apt install python3-pip

virtualenvwrapper

virtualenvwrapper is a set of extensions to virtualenv. It provides commands like mkvirtualenv, lssitepackages, and especially workon for switching between different virtualenv environments.

Install virtualenvwrapper via pip3:

pip3 install virtualenvwrapper

Navigate to the bottom of the .bashrc file, insert mode of Vim and add these rows:

#Virtualenvwrapper settings:
export WORKON_HOME=$HOME/.virtualenvs
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
. /usr/local/bin/virtualenvwrapper.sh

To create a virtual environment in Python3 and activate it immediately use this command in your terminal:

mkvirtualenv name_of_your_env

To deactivate the environment use the deactivate command.

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