Created
May 26, 2016 10:42
-
-
Save alayek/90d77495291812539835b3cfe037ac47 to your computer and use it in GitHub Desktop.
Python install requests and import it
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
try: | |
import requests | |
except ImportError: | |
import pip | |
pip.main(['install', 'requests']) # if not running in venv, pass the --users flag too | |
import requests | |
r = requests.get('https://api.github.com/events') | |
print(r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment