Setup Python Web Development Env on Ubuntu 18.04

My stack is based on Python, with Flask.

Installing Python

If needed

  1. Download the latest stable on the official website.
  2. Follow that

Setup Git & GitHub

First config the Git account

config --global user.email "my@email.address"
config --global user.name "Jonathan Gall"

As I use 2-factor authentification to push on GitHub, additional steps are needed. Login at the personal access token page and create one with at least all the repo rights.

Create virtual environment

That part didn't went smoothly on my fresh install. Followed this and that.

  1. First start by updating/cleaning the env to avoid breaks and conflicts
sudo apt-get update && sudo apt-get -f install && sudo apt-get dist-upgrade
  1. Add python3-venv package and pip
sudo apt-get install python3-venv python3-pip
  1. Create Virtual Environment
python3 -m venv venv

first venv to create a virtual enviromment, second one to name it

An alternative is also to install virtual env with pip

pip3 install virtualenv
  1. Activate the environment
source venv/bin/activate