How to install Homebrew, Pyenv, Pipenv in WSL (Windows) Ubuntu 20.04

Why homebrew? :

Homebrew Installation :

  • Follow the steps mentioned in the below script
$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

output and follow next steps :

install homebrew dependencies for Ubuntu (If needed) :

$sudo apt-get install build-essential procps curl file git

Test installation by running below command:

$brew install hello

Pyenv installation

Why pyenv ? :

  • pyenv lets you to switch between python versions in ubuntu.

Install python build dependencies for ubuntu :

$sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

then run

$curl https://pyenv.run | bash

Below lines should be available in .bashrc

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Restart Shell (If needed) :

$exec $SHELL

or

Run below in windows command prompt :

wsl --shutdown 
& login into ubuntu again

PIPENV Installation

Why pipenv? :

  • pipenv is used to create virtual environment, similar to venv,virtualenv,conda,etc.

Install pipenv using homebrew :

$brew install pipenv

output:
image

References :

20