If you are on Mac and have been running your script like this python my-script.py, you might want to try running it with sudo. I spent 30 minutes debugging correct code before realizing that "requests" needs sudo permissions
python my-script.py
sudo