Skip to content

Instantly share code, notes, and snippets.

@bobbyjam99-zz
Created December 19, 2014 05:56
Show Gist options
  • Save bobbyjam99-zz/862b7fd59880d8f01330 to your computer and use it in GitHub Desktop.
Save bobbyjam99-zz/862b7fd59880d8f01330 to your computer and use it in GitHub Desktop.
proxy越しのeasy_installコマンドのインストール

Sphinxをインストールするため http://sphinx-users.jp/gettingstarted/install_windows.html を参考にインストール。 easy_install をインストールする際 set HTTP_PROXY=http://username:password@proxy:port を設定して実行するもプロキシ認証が成功しなかった。

そこで ez_setup.py の

    ps_cmd = (
        "[System.Net.WebRequest]::DefaultWebProxy.Credentials = "
        "[System.Net.CredentialCache]::DefaultCredentials; "
        "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)"
        % vars()
    )

    ps_cmd = (
        "[System.Net.WebRequest]::DefaultWebProxy.Credentials = "
        "(new-object System.Net.NetworkCredential(username, password)); "
        "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)"
        % vars()
    )

に書き換えて実行したら成功した。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment