proxy = urllib.request.ProxyHandler({'http': 'yourproxy.com'})
opener = urllib.request.build_opener(proxy)
urllib.request.install_opener(opener)
urllib.request.urlopen('http://www.google.com')
Python always returning Network is unreachable because of old ipv6 configuration