Linux中openssl/opensslv.h找不到问题的解决方法
作者:bladestone 发布时间:2021-09-06 01:53:12
前言
众所周知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系统中都存在类似的问题,在安装特定安装包的过程中,其依赖某些第三方开发包,会曝出某些文件找不到的错误,一般情况下是需要安装依赖包的开发版本的。 这个规则应该是通用的。
好了,以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对脚本之家的支持。
来源:http://blog.csdn.net/blueheart20/article/details/65653670


猜你喜欢
- 我们的所有托管计划都会含有一些免费的server-side applications,你可以在建设网站及客户化你的网站时使用它们。可以通过访
- 日前,新闻出版总署对已出版运营的200多款包括网页游戏在内的网络游戏进行集中审查。《美国1930》等45款未经审批的境外网络游戏被责令关闭,
- 确保关键任务应用程序始终可用是 IT 部门提供的一项关键服务,而且“高可用性”是 Windows S
- com国际域名从到期到掉下来时间为:30+30+5=65天域名到期后13天内仍可以正常解析和管理,并可以在线续费,续费价格与注册域名价格相同
- 代理共享上网和控制 * 权限,界面友好,设置简单,功能强大。支持Modem代理/ADSL代理/宽带代理/Cable Modem代理等方式共
- “在查看您的帐户时,我们注意到您目前在展示 Google 广告时所采用的方式不符合我们的政策。例如,我们发现在类似 URL的网页上有违反 A
- 为使广大站长更顺利地安装上康盛创想(Comsenz)推出的社区产品 UCenter 1.5,UCenter Home 2.0 和 Discu
- 美国《财富》杂志网络版周四评出了2009年全球最具影响力商界女强人50强,百事可乐董事长兼CEO卢英德(Indra Nooyi)居首,雅虎C
- 前几天同事要在centos上安装一个oracle数据库需要在现有系统上加一块盘,本不是很难得问题结果没写入fstab文件,重新开机后盘又要重
- 如果您的服务器正在受ASP木马的困扰,那么希望这篇文章能帮您解决您所面临的问题。目前比较流行的ASP木马主要通过三种技术来进行对服务器的相关
- 服务器磁盘的运作情况在一定程度上反应系统的负载。磁盘通常是服务器最慢的设备,极容易出现瓶颈,通过监控可以判断出整个系统的短板。zabbix并
- 伴随着UCenter Home(简称UCHome)1.5的发布,国内越来越多垂直细分的社交网站采用UCHome搭建。同时,Manyou开放平
- 修改配置文件 conf/httpd.conf 1.加入下面两句 NameVirtualHost *:80 Include conf/vhos
- 如何写好一篇高质量的软文是每个站长都很头疼的问题?作为一个站长除了做站外每天忙的最多的事情就是写文章,推广、SEO、流量、网赚、做站心得,写
- 来学习一下多次执行同一条命令的不同类型的循环。awk 脚本有三个主要部分:BEGIN 和 END 函数(都可选),用户自己写的每次要执行的函
- 如何才能让搜索引擎快速搜录你的网站,我总结了一下,大概有一下几点:1、提交给搜索引擎,这个相对简单,不详细说明;2、交换友情链接,比如说CH
- 一、网站推广目标线下推广是跟博客推广,论坛推广,搜索引擎推广等线上推广相反的一种推广方式,它更侧重于传统模式的而非网络模式的推广,注重实际生
- 尽管看似已经是天下太平,但是实际上,微软、雅虎与伊坎之间的传奇故事还远没有到结束的时候,硅谷对此的最新看法是,雅虎很可能握有微软希望得到的某
- 一年前做过一个论坛,那是google adsense疯狂的时候,因此也抓住了最后一把小赚了一笔,后来因为论坛管制严格,空间不稳定等因素被迫关
- 经常见到某些网站提供个人主页,显得很神气,其实你也可以开放你机器上的空间给别人,这很简单就能实现。只要你按照下面的提示对你的WWW服务器配置