Created
April 28, 2017 19:04
-
-
Save cthoyt/c97536c3b85518c9e41e379507be48ee to your computer and use it in GitHub Desktop.
Programatically use pip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pip is actually a python package! | |
import pip | |
# It's screwy and not really written to be used this way, but we still can | |
pip_install_cmd = pip.commands.InstallCommand() | |
# load up all the args you'd use after pip install and away we go! | |
args = ['--upgrade', '--user', 'requests'] | |
pip_install_cmd.main(args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment