gpt4 book ai didi

python - 使用 pip 安装 pyopenssl 时出错

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:47:50 24 4
gpt4 key购买 nike

我正在尝试使用 python pip 安装不同的包,但出现此错误:

File "/usr/local/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/_vendor/ cnx.set_tlsext_host_name(server_hostname) AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'

我找到了一些解决方法,我发现我需要安装 pyoepnssl .

当我尝试手动安装 pyopenssl 时出现错误:

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c OpenSSL/ssl/connection.c -o build/temp.linux-x86_64-2.7/OpenSSL/ssl/connection.o 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: command 'gcc' failed with exit status 1

我已经安装了所有库 gcc、python-devel、gcc-c++、libffi-devel、openssl-devel。我正在使用红帽 4

我不知道我是否遗漏了一些图书馆。

任何建议。

提前致谢

最佳答案

For Ubuntu:

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

For RedHat:

sudo yum remove pyOpenSSL
sudo pip install pyopenssl

方法二:

easy_install http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.12.tar.gz

执行上述行可能会解决您的问题。

关于python - 使用 pip 安装 pyopenssl 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40089841/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com