LoginSignup
4
3

More than 5 years have passed since last update.

Proxy環境下での pip install (Windows)

Last updated at Posted at 2017-02-28

Proxy環境下にある Windows から pip でパッケージを導入する場合、
--proxy オプションを使用することで対応できます。

pip install <パッケージ名> --proxy http://xxx.xxx.xxx.xxx:xxxx

※Python 3.5 on Windows7(64bit)

複数の環境で作業を行うため Proxy を切り替える必要がある場合は、
環境変数でそれぞれの環境の proxy を定義して切り替えればよさそうです。

【環境変数】
Proxy-A=http://aaa.aaa.aaa.aaa:aaa
Proxy-B=http://bbb.bbb.bbb.bbb:bbbb

【コマンド】
pip install <パッケージ名> --proxy %Proxy-A%

環境に合わせて Proxy 環境変数を切り替えれば更に操作が楽になりそうですが、
コマンドプロンプトでどうやって実装するんだろう・・・
(bash なら .bashrc で制御すればできそうだろうけど)

4
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
4
3