pip install version of package code example

Example 1: pip install specific version

# To install a specific version of a package using pip:
pip install Package_name==version

# Example:
pip install MySQL_python==1.2.2

Example 2: how to pip install a specific version

# At the time of writing this numpy is in version 1.19.x
# This statement below will install numpy version 1.18.1
python -m pip install numpy==1.18.1

Example 3: update pip

sudo pip3 install --upgrade pip

Example 4: get version package from pip

$ pip show Jinja2
---
Name: Jinja2
Version: 2.7.3
Location: /path/to/virtualenv/lib/python2.7/site-packages
Requires: markupsafe