我在 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 失败
发布评论