python install module in python file 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 modules in python
# In cmd.exe type:
pip install #module_name
Example 3: install python package
pip3/pip2 install <package>