pip install -U code example

Example 1: how to install pip

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
#Once you do that, enter line 3 inside
python get-pip.py

Example 2: how to install python libraries

python -m pip install SomePackage

Example 3: install pip in ubtunut

sudo apt install python3-pip

Example 4: start virtualenv

source env/bin/activate

Example 5: how to install packages inside thepython script

import sys
import subprocess

# implement pip as a subprocess:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 
'<packagename>'])

Example 6: how to make a virtual environment in python

.\env\Scripts\activate