easy_install PyOpenSSL error

孤者浪人 提交于 2019-11-28 07:32:08
Wael Ben Zid El Guebsi

In order to install it under virtualenv, you should first install the required packages. On ubuntu:

sudo apt-get install python-dev libffi-dev libssl-dev

Then you can just type:

pip install pyopenssl

pyOpenSSL 0.13 introduced support for the (S)erver (N)ame (I)ndication TLS extension. This extension allows clients to tell the server what hostname they expect to be talking to, allowing the server to select a suitable certificate to present.

Support for SNI was introduced in OpenSSL 0.9.8f. Thus, pyOpenSSL 0.13 will build with OpenSSL 0.9.8f or later, but not OpenSSL 0.9.8e or earlier, where the APIs it expects to be wrapping do not exist.

Perhaps a newer version of pyOpenSSL will make these bindings optional, restoring support for OpenSSL 0.9.8e and earlier. However, similarly, a newer version of OpenSSL will also work with pyOpenSSL 0.13.

The pyOpenSSL project issues pre-releases. Widespread testing of pre-releases can help avoid cases like this one. I recommend that anyone relying on pyOpenSSL subscribe to the (very low traffic) pyOpenSSL user list (or on SourceForge) and do what testing you can when a pre-release comes out, before the release is finalized.

I ran into this while trying to install Scrapy. For me, Thanasis' answer didn't work. After some more Google and randomly installing things

yum install python-devel

allowed the Scrapy install to run for me (CentOS release 6.3 (Final))

Not exactly what is asked, but in Ubuntu 12.04 it can be installed with:

sudo apt-get install python-openssl

For me I had to install the openssl-devel libs:

yum install openssl-devel

Was trying to install the cyclone/tornado/twisted python evented lib.

If you don't need to use the lastest pyOpenSSL, just rolled back to 0.12, this is the simplest way.

pip install pyOpenSSL==0.12

Check for @Jean-Paul's answer for detail.

Try to install:

sudo apt-get install -y python-dev libssl-dev libffi-dev

I couldn't install libssl-devel or libssl-dev, but this worked for me on CentOS 6 (when pyOpenSSL 0.13.1 was previously installed):

sudo yum -y remove pyOpenSSL.x86_64
sudo yum -y install libffi-devel
#sudo yum -y install libssl-devel 
sudo yum -y install openssl-devel 
sudo yum -y install python-devel
sudo pip install pyopenssl

We had the same issue. Checking a bit we found a way to resolve it: https://bugs.launchpad.net/pyopenssl/+bug/845445

What you're looking for is "Philip's fix works for me on CentOS 5.6:": https://bugs.launchpad.net/pyopenssl/+bug/845445/comments/9

This worked well in our case.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!