I am trying to install BeautifulSoup4 using the command pip install BeautifulSoup4
, as per the bs documentation here:
https://www.crummy.com/software/BeautifulSoup/#Download
I am using Mac OS X 10.7.5, and python 2.7.12
When I run the command in Terminal I get the error:
AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
Can anyone suggest what I'm doing wrong? Thanks in advance.
EDIT:
In light of comments I have tried to run sudo pip install pyopenssl
however I get the same 'socketobject' error.
From what I understand, the pyopenssl
package version installed system-wide is not up-to-date. Upgrade it:
sudo pip install --upgrade pyopenssl
Or, remove it and install the latest in your virtual environment:
$ sudo pip uninstall pyopenssl
$ # activate virtual environment
(myvirtualenv) $ pip install --upgrade pyopenssl
"That happend because your OS has old pyOpenSSL library which is does not an accept attribute 'set_tlsext_host_name'. To fix this, you need to add dependence pyOpenSSL >= 0.13.
$ brew purge python-openssl
$ brew install libffi-dev
$ brew install pyOpenSSL
Let me know if this is unclear or if it doesn't work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With