在 ubuntu 14.04 上安装 Scrapy 失败

编程入门 行业动态 更新时间:2024-10-28 10:28:27
本文介绍了在 ubuntu 14.04 上安装 Scrapy 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在 ubuntu 机器上安装 Scrapy 时出错.我正在使用 pip 安装 Scrapy.我知道它需要安装 setuptools.我使用 setuptools 网站中提供的脚本安装了它.

I'm getting error installing Scrapy on my ubuntu box. I'm using pip to install Scrapy. I'm aware that it needs setuptools to be installed. I got that installed using the script provided in setuptools website.

reading manifest file 'Twisted.egg-info/SOURCES.txt' writing manifest file 'Twisted.egg-info/SOURCES.txt' creating build/lib.linux-x86_64-2.7/twisted/internet/iocpreactor/iocpsupport copying twisted/internet/iocpreactor/iocpsupport/iocpsupport.c -> build/lib.linux-x86_64-2.7/twisted/internet/iocpreactor/iocpsupport copying twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c -> build/lib.linux-x86_64-2.7/twisted/internet/iocpreactor/iocpsupport copying twisted/test/raiser.c -> build/lib.linux-x86_64-2.7/twisted/test copying twisted/runner/portmap.c -> build/lib.linux-x86_64-2.7/twisted/runner copying twisted/python/sendmsg.c -> build/lib.linux-x86_64-2.7/twisted/python running build_ext x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c conftest.c -o conftest.o building 'twisted.runner.portmap' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/twisted creating build/temp.linux-x86_64-2.7/twisted/runner x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c twisted/runner/portmap.c -o build/temp.linux-x86_64-2.7/twisted/runner/portmap.o twisted/runner/portmap.c:10:20: fatal error: Python.h: No such file or directory #include <Python.h> ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Cleaning up... Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Twisted/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4QNuNV-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/Twisted Storing debug log for failure in /root/.pip/pip.log

知道过程哪里出错了吗?我已经安装了 gcc 和 g++.

Any Idea where the process goes wrong? I've got gcc and g++ installed already.

推荐答案

从错误 fatal error: Python.h: No such file or directory 看来没有安装 python 开发头文件.尝试此命令,然后再次尝试安装.

From the error fatal error: Python.h: No such file or directory it looks like python development headers are not installed. Try this command and then try to install again.

sudo apt-get install python-dev

要安装 libevent 库,请应用此命令,

For installing libevent library apply this command,

sudo apt-get install libevent-dev

更多推荐

在 ubuntu 14.04 上安装 Scrapy 失败

本文发布于:2023-06-03 08:57:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/470193.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ubuntu   Scrapy

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!