Looks like I have found (with your help) a solution. Instead of: logging.getLogger('requests.packages.urllib3').setLevel(logging.ERROR) the line should look like: logging.getLogger('urllib3').setLevel(logging.ERROR) After changing the line, everything is OK. Thank you all. Regards.