easy_install PyOpenSSL error

2019-01-14 06:56发布

Any idea about what cause the error below ?

I use Linux centos with openssl-devel.i386 0.9.8e-12.el5_5.7

$ easy_install PyOpenSSL
Searching for PyOpenSSL
Reading http://pypi.python.org/simple/PyOpenSSL/
Reading http://launchpad.net/pyopenssl
Reading http://pyopenssl.sourceforge.net/
Best match: pyOpenSSL 0.13
Downloading http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz#md5=767bca18a71178ca353dff9e10941929
Processing pyOpenSSL-0.13.tar.gz
Running pyOpenSSL-0.13/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Dunib/pyOpenSSL-0.13/egg-dist-tmp-aV6OCC
warning: no previously-included files matching '*.pyc' found anywhere in distribution
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_context’:
OpenSSL/ssl/connection.c:289: warning: implicit declaration of function ‘SSL_set_SSL_CTX’
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_get_servername’:
OpenSSL/ssl/connection.c:313: error: ‘TLSEXT_NAMETYPE_host_name’ undeclared (first use in this function)
OpenSSL/ssl/connection.c:313: error: (Each undeclared identifier is reported only once
OpenSSL/ssl/connection.c:313: error: for each function it appears in.)
OpenSSL/ssl/connection.c:320: warning: implicit declaration of function ‘SSL_get_servername’
OpenSSL/ssl/connection.c:320: warning: assignment makes pointer from integer without a cast
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_tlsext_host_name’:
OpenSSL/ssl/connection.c:346: warning: implicit declaration of function ‘SSL_set_tlsext_host_name’
error: Setup script exited with error: command 'gcc' failed with exit status 1

9条回答
姐就是有狂的资本
2楼-- · 2019-01-14 07:26

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
查看更多
▲ chillily
3楼-- · 2019-01-14 07:32

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

sudo apt-get install python-openssl
查看更多
虎瘦雄心在
4楼-- · 2019-01-14 07:33

Try to install:

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

查看更多
倾城 Initia
5楼-- · 2019-01-14 07:36

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.

查看更多
在下西门庆
6楼-- · 2019-01-14 07:37

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.

查看更多
狗以群分
7楼-- · 2019-01-14 07:39

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))

查看更多
登录 后发表回答