Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python setup.py fails on osx with ssl error

I am trying to upload a new python project from my mac to PyPI via:

python setup.py sdist upload -r pypi

When I try to upload a package, I get the following error on OSX:

Submitting dist/PyTreasuryDirect-0.1.0.tar.gz to https://pypi.python.org/pypi
error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>

This question is slightly related to these two questions, ssl with pip and when importing the ssl library. However I need setup.py to work in my case, how can I get past this ssl error?

I also get the same error on Python 2.7.9 and Python 3.5 using OSX 10.10.2 (14C109)

like image 633
pyCthon Avatar asked Nov 10 '22 15:11

pyCthon


1 Answers

The solution for OS X 10.10 is to use its default Python version 2.7.6.

This problem is related to the fact that starting from Python version 2.7.9 certificate validation for stdlib http clients is enabled by default (PEP 476). This issue is described in Python bug tracker.

like image 113
baf Avatar answered Nov 14 '22 23:11

baf