LoginSignup
10
9

More than 5 years have passed since last update.

[OSX][pyenv]pipでSSLのエラーが起きた時の対処

Last updated at Posted at 2015-12-28

Pythonを3.5と2.7.10に入れ替えていつも通りにパッケージ入れようとしたら
pip._vendor.requests.exceptions.SSLError: unknown error (_ssl.c:3031)
とかでてきまして困りました。
環境は、OSX Yosemite, pyenvでPythonのバージョン管理をしています。

ということで対処法を。まずは普通のPythonならば、

Users/(あなたのなまえ)/.pyenv/versions/2.7.10 or 3.5.0/lib/python2.7 or python3.5/site-packages/pip/download.py 

を、Anacondaならば、

Users/(あなたのなまえ)/.pyenv/anaconda-(バージョン名)/lib/python(バージョン名)/site-packages/pip/download.py 

を下記の通り修正したらOK。

# Dispatch the actual request
return super(PipSession, self).request(method, url, *args, **kwargs)

から

# Dispatch the actual request
return super(PipSession, self).request(method, url, verify=False, *args, **kwargs)

へ。これでOK。
(verify=Falseを追加しています)

[参考]
http://qiita.com/_akisato/items/4b531aab65de8cd2909a

10
9
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
10
9