Try this and see if it works. You could have a DNS issue so try an IP address instead of a DNS name and check if it is faster. Failing that, there is a known problem with proxy detection in the requests library even if you have your system setup to bypass which I imagine you have in this case.
import requests
session = requests.Session()
session.trust_env = False
response = session.get('http://jenkins-server/api/json', params={'pretty':'true'},
auth=("username", "password")))
This code snippet comes from here and talks about the same problem:
python - requests: how to disable / bypass proxy - Stack Overflow[
^]