安裝scrapy報(bào)錯(cuò)error: command 'x86_64-linux-gnu-gcc' failed with exit status 1處理

報(bào)錯(cuò)信息如下:

 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
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-oH9M6v/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -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: 沒(méi)有那個(gè)文件或目錄
     #include <openssl/opensslv.h>
                                  ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Command "/home/echo/workspace/learnscrapy/venv/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9Rii3g/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-mgCoV9-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/echo/workspace/learnscrapy/venv/include/site/python2.7/cryptography" failed with error code 1 in /tmp/pip-build-9Rii3g/cryptography/

意思是在安裝的時(shí)候找不到openssl.h這個(gè)頭文件,在ubuntu14.04下使用下面命令可以解決這個(gè)問(wèn)題:

sudo apt install libssl-dev

之后再執(zhí)行pip install scrapy就不會(huì)報(bào)錯(cuò)了

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容