The Python Oracle

AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle2

--

Chapters
00:00 Attributeerror: '_socketobject' Object Has No Attribute 'Set_tlsext_host_name'
00:50 Accepted Answer Score 14
00:59 Answer 2 Score 3
01:15 Answer 3 Score 2
01:22 Thank you

--

Full question
https://stackoverflow.com/questions/3157...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #ubuntu #ssl #https #pythonrequests

#avk47



ACCEPTED ANSWER

Score 14


The fix for me was the following:

sudo apt-get purge python-openssl
sudo pip install pyopenssl



ANSWER 2

Score 3


This was able to get the python working on Ubuntu 12.04.3 LTS for me.

sudo apt-get install python-dev python-pip build-essential libffi-dev
sudo -H pip install --upgrade pip setuptools && sudo -H pip install --upgrade pyopenssl



ANSWER 3

Score 2


On RedHat:

sudo yum remove pyOpenSSL
sudo pip install pyopenssl