关于ssl问题

45 篇文章 1 订阅
Collecting itchat
  Could not fetch URL https://pypi.python.org/simple/itchat/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
##python3中安装第三方包时报错


[root@foundation31 /opt/Python-3.6.4/Modules]#vim  Setup  ##在你安装目录下



205 #_socket socketmodule.c
206 _socket socketmodule.c
207 # Socket module helper for SSL support; you must comment out the other
208 # socket line above, and possibly edit the SSL variable:
209 #SSL=/usr/local/ssl
210 #_ssl _ssl.c \
211 #       -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
212 #       -L$(SSL)/lib -lssl -lcrypto
213 _ssl _ssl.c \
214        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
215        -L$(SSL)/lib -lssl -lcrypto
##修改ssl的这行
[root@foundation31 /opt/Python-3.6.4]#./configure ##重新编译(刷新)
[root@foundation31 /opt/Python-3.6.4]#make  &&  make  install  ##安装
./Modules/_ssl.c:67:25: fatal error: openssl/rsa.h: No such file or directory
 #include "openssl/rsa.h"  ##报错



##百度:
出现这个或者fatal error: openssl/名单.h: No such file or directory。都是没有安装
libssl-dev~

libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl对ssl进行了实现~

pip  install libssl-dev
 Could not find a version that satisfies the requirement libssl-dev (from versions: )
No matching distribution found for libssl-dev

easy_install  libssl-dev





##2.
python2中自带ssl


yum  install openssl-devel -y

解决办法是重新对python3.6进行编译安装,用一下过程来实现编译安装:

cd Python-3.6.2
./configure --with-ssl
make  && make install
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值