pip - Installing python module within code - Stack Overflow
https://stackoverflow.com/questions/12332975/installing-python-module-within-code
Sep 08, 2012 . Use sys.executable to ensure that you will call the same pip associated with the current runtime. import subprocess import sys def install (package): subprocess.check_call ( [sys.executable, "-m", "pip", "install", package]) Share. Improve this answer. Follow this answer to receive notifications.
DA: 100 PA: 86 MOZ Rank: 61