You may need a newer version of the request. I just tried this with v2.5.1:
from requests.packages.urllib3.util import Retry
It seems to need work. FYI: latest version v2.5.3, worth updating.
In addition, if you have a fairly recent version of urllib3 installed separately, this should also work:
from urllib3.util import Retry
Unfortunately, we are checking the specific type of isinstance Retry in PoolManager and ConnectionPool , so the two types of Retry objects may not be completely interchangeable. (If someone wants to fix this, I would add +1 to PR.)
Now, if you plan to use the Retry object with requests version of urllib3 , you will need to import it directly from it.
shazow
source share