pip install inside python code example
Example 1: python install module from script
import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
Example 2: how to install python libraries
python -m pip install SomePackage
Example 3: how to download packages using pip
pip install package name