Skip to content

Instantly share code, notes, and snippets.

@pashri
Created February 1, 2021 03:09
Show Gist options
  • Save pashri/a623e08d7ade0c8faa3eb1c1542f3435 to your computer and use it in GitHub Desktop.
Save pashri/a623e08d7ade0c8faa3eb1c1542f3435 to your computer and use it in GitHub Desktop.
Pip install into current environment from within a script
import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment