全网整合营销服务商

电脑端+手机端+微信端=数据同步管理

免费咨询热线:400-708-3566

Linux中openssl/opensslv.h找不到问题的解决方法

前言

众所周知scrapy是Python中鼎鼎大名的爬虫框架,在安装scrapy过程中碰到了openssl某个文件找不到的问题,并进行了分析,记录之。

一、 scrapy以及安装过程

Scrapy是python中鼎鼎大名的爬虫框架,笔者在Centos 7系统之上进行安装,发现了如下问题:

   >> pip install scrapy

由于安装过程中的过程信息比较多,这里只列出了其中的关键片段信息:

 running egg_info 
 writing requirements to src/cryptography.egg-info/requires.txt 
 writing src/cryptography.egg-info/PKG-INFO 
 writing top-level names to src/cryptography.egg-info/top_level.txt 
 writing dependency_links to src/cryptography.egg-info/dependency_links.txt 
 writing entry points to src/cryptography.egg-info/entry_points.txt 
 reading manifest file 'src/cryptography.egg-info/SOURCES.txt' 
 reading manifest template 'MANIFEST.in' 
 no previously-included directories found matching 'docs/_build' 
 warning: no previously-included files matching '*' found under directory 'vectors' 
 writing manifest file 'src/cryptography.egg-info/SOURCES.txt' 
 running build_ext 
 generating cffi module 'build/temp.linux-x86_64-2.7/_padding.c' 
 creating build/temp.linux-x86_64-2.7 
 generating cffi module 'build/temp.linux-x86_64-2.7/_constant_time.c' 
 generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c' 
 building '_openssl' extension 
 creating build/temp.linux-x86_64-2.7/build 
 creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7 
 gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o 
 build/temp.linux-x86_64-2.7/_openssl.c:434:30: fatal error: openssl/opensslv.h: No such file or directory 
 #include <openssl/opensslv.h> 
     ^ 
 compilation terminated. 
 error: command 'gcc' failed with exit status 1 
 
 ---------------------------------------- 
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-hRMlG0/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ReCoWo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-hRMlG0/cryptography/ 
[root@AY131203102210033c39Z ~]# yum install openssl build/temp.linux-x86_64-2.7/_openssl.c:434:30: fatal error: openssl/opensslv.h: No such file or directory 
^C 
 
Exiting on user cancel. 

由于确实openssl.c文件而安装失败了,貌似没有找到对应的文件

二、问题分析

首先怀疑openssl没有安装,故先进行openssl的检查:

  >> yum info openssl 

Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
 * base: mirrors.aliyun.com 
 * epel: mirrors.aliyun.com 
 * extras: mirrors.aliyun.com 
 * updates: mirrors.aliyun.com 
Installed Packages 
Name : openssl 
Arch : x86_64 
Epoch : 1 
Version : 1.0.1e 
Release : 60.el7_3.1 
Size : 1.5 M 
Repo : installed 
Summary : Utilities from the general purpose cryptography library with TLS implementation 
URL  : http://www.openssl.org/ 
License : OpenSSL 
Description : The OpenSSL toolkit provides support for secure communications between 
  : machines. OpenSSL includes a certificate management tool and shared 
  : libraries which provide various cryptographic algorithms and 
  : protocols. 

基于其中的信息可以得知,openssl是一家安装过了,怎么还是会缺少openssl.c的文件呢?

经过一番思考,豁然发现一个基本规则, openssl已经安装二进制的可执行程序,而这里的安装scrapy则需要的是openssl的源文件程序,比如openssl.h。故这里需要补充安装的是openssh.h的开发版,其中包含相关的安装源代码文件。

三、问题的解决

在确认了问题之后,接下来就是安装openssl-devel的安装包了:

  >> yum install openssl-devel

在安装完成之后,重新安装scrapy,就可以顺利安装成功了

总结

推而广之,在Linux系统中都存在类似的问题,在安装特定安装包的过程中,其依赖某些第三方开发包,会曝出某些文件找不到的错误,一般情况下是需要安装依赖包的开发版本的。 这个规则应该是通用的。

好了,以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对的支持。


# opensslv.h  # 找不到  # openssl  # 编译内核opensslv.h  # linux系统中使用openssl实现mysql主从复制  # linux下安装openssl、swoole等扩展的详细步骤  # 如何正确使用Nodejs 的 c++ module 链接到 OpenSSL  # 浅析PKI加密解密 OpenSSL  # Windows安装配置C/C++(VS2017)OpenSSL开发环境配置教程  # 的是  # 过程中  # 鼎鼎大名  # 推而广之  # 好了  # 出了  # 过了  # 是一家  # 这篇文章  # 谢谢大家  # 第三方  # 比较多  # 没有找到  # 中都  # 众所周知  # 可执行  # 源代码  # 已经安装  # 进行了 


相关文章: 成都响应式网站开发,dw怎么把手机适应页面变成网页?  极客网站有哪些,DoNews、36氪、爱范儿、虎嗅、雷锋网、极客公园这些互联网媒体网站有什么差异?  小型网站建站如何选择虚拟主机?  如何解决ASP生成WAP建站中文乱码问题?  如何快速搭建高效WAP手机网站?  如何快速搭建响应式可视化网站?  平台云上自助建站如何快速打造专业网站?  如何生成腾讯云建站专用兑换码?  如何在阿里云虚拟服务器快速搭建网站?  如何通过免费商城建站系统源码自定义网站主题与功能?  建站之星各版本价格是多少?  制作营销网站公司,淘特是干什么用的?  如何获取PHP WAP自助建站系统源码?  手机网站制作与建设方案,手机网站如何建设?  建站之星伪静态规则如何设置?  PHP 500报错的快速解决方法  专业网站制作企业网站,如何制作一个企业网站,建设网站的基本步骤有哪些?  北京网站制作网页,网站升级改版需要多久?  动图在线制作网站有哪些,滑动动图图集怎么做?  如何快速搭建高效服务器建站系统?  内部网站制作流程,如何建立公司内部网站?  建站DNS解析失败?如何正确配置域名服务器?  如何在建站宝盒中设置产品搜索功能?  西安市网站制作公司,哪个相亲网站比较好?西安比较好的相亲网站?  制作网站公司那家好,网络公司是做什么的?  建站VPS能否同时实现高效与安全翻墙?  如何快速搭建FTP站点实现文件共享?  Swift中switch语句区间和元组模式匹配  建站之星代理如何获取技术支持?  建站之星与建站宝盒如何选择最佳方案?  建站为何优先选择香港服务器?  网站制作企业,网站的banner和导航栏是指什么?  如何选择建站程序?包含哪些必备功能与类型?  如何快速搭建高效简练网站?  天津个人网站制作公司,天津网约车驾驶员从业资格证官网?  c++怎么用jemalloc c++替换默认内存分配器【性能】  Python多线程使用规范_线程安全解析【教程】  音乐网站服务器如何优化API响应速度?  如何通过商城免费建站系统源码自定义网站主题?  厦门模型网站设计制作公司,厦门航空飞机模型掉色怎么办?  如何确保西部建站助手FTP传输的安全性?  装修招标网站设计制作流程,装修招标流程?  建站之星会员如何解锁更多建站功能?  Python如何创建带属性的XML节点  如何通过西部建站助手安装IIS服务器?  香港服务器网站卡顿?如何解决网络延迟与负载问题?  自助网站制作软件,个人如何自助建网站?  建站主机如何安装配置?新手必看操作指南  C#怎么创建控制台应用 C# Console App项目创建方法  已有域名建站全流程解析:网站搭建步骤与建站工具选择 

您的项目需求

*请认真填写需求信息,我们会在24小时内与您取得联系。