import subprocess import sys def install(package): subprocess.check_call([sys.executable, "-m", "pip", "install", package])
python -m pip install SomePackage