3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Pythonのproxy回避

Posted at

はじめに

会社内でmnist.load_data()などで外部のdatasetを利用しようとした場合に、社内のproxyに阻まれてしまいました。さらに、proxyに認証が必要な場合の記事が見つからなかったので、情報共有のために記事にしました。

回避方法

import urllib
proxy_support = urllib.request.ProxyHandler({'https':'http:userName:password@proxy_adress:portNumber'})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener)

こちらの2行目のuserNameとpasswordに自分の社内の認証IDとPASSを記入してください。
そして、@の後に自分の会社のプロキシサーバのアドレスとポート番号を各々当てはめてくれれば通過できると思います。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?