一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Linux|Centos|Ubuntu|系統進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務器之家 - 服務器系統 - Linux - Linux中openssl/opensslv.h找不到問題的解決方法

Linux中openssl/opensslv.h找不到問題的解決方法

2022-01-25 17:05bladestone Linux

最近在安裝scrapy過程中碰到了openssl某個文件找不到的問題,通過查找相關的資料進行了解決,下面這篇文章主要給大家分享了關于Linux中openssl/opensslv.h找不到問題的解決方法,需要的朋友可以參考借鑒,下面來一起看看吧。

前言

眾所周知scrapy是Python中鼎鼎大名的爬蟲框架,在安裝scrapy過程中碰到了openssl某個文件找不到的問題,并進行了分析,記錄之。

一、 scrapy以及安裝過程

Scrapy是python中鼎鼎大名的爬蟲框架,筆者在Centos 7系統之上進行安裝,發現了如下問題:

   >> pip install scrapy

由于安裝過程中的過程信息比較多,這里只列出了其中的關鍵片段信息:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 亚洲精品国产一区二区三区在 | 男人天堂色 | 青青草精品在线 | 久久久精品成人免费看 | 24adc年龄18岁欢迎大驾光临 | 奇米影视7777 | 久久成人免费大片 | 精品国产无限资源免费观看 | 日韩一卡2卡3卡新区网站 | 亚裔maricahase和黑人 | 欧美福利二区 | 国内老司机精品视频在线播出 | 秀逼逼 | 俺去俺也在线www色官网 | 欧美日韩一区二区三区免费不卡 | 国产成人久久精品一区二区三区 | 5g影院天天5g爽天天看 | 男公厕里同性做爰 | 91tm视频 | 国产一级持黄大片99久久 | 1024免费福利永久观看网站 | 无套白浆 | 色鬼网 | 湿好紧太硬了我太爽了 | 天天噜| 精品无码国产AV一区二区三区 | 国语第一次处破女 | 小sao货水好多真紧h的视频 | 污文啊好棒棒啊好了 | 非洲一级毛片又粗又长aaaa | 亚洲免费视频一区 | 午夜国产视频 | 亚洲国产精品无码中文字满 | 国产精品久久久久毛片真精品 | 日本生活中的玛丽 | 毛片在线观看网站 | 日韩在线观看免费 | 国产一级在线观看视频 | 日本免费三区 | 青青草99久久精品国产综合 | 国产成人亚洲综合a∨婷婷 国产成人亚洲精品乱码在线观看 |