【发布时间】:2013-07-10 18:49:20
【问题描述】:
当我尝试使用命令sudo easy_install -U Scrapy 在 ubuntu 13.04 上安装 Scrapy 时,我收到以下错误:
Searching for Scrapy
Reading pypi.python.org/simple/Scrapy/
Best match: Scrapy 0.16.5
Processing Scrapy-0.16.5-py2.7.egg
Scrapy 0.16.5 is already the active version in easy-install.pth
Installing scrapy script to /usr/local/bin
Using /usr/local/lib/python2.7/dist-packages/Scrapy-0.16.5-py2.7.egg
Processing dependencies for Scrapy
Searching for Twisted>=8.0
Reading pypi.python.org/simple/Twisted/
Best match: Twisted 13.1.0
Downloading pypi.python.org/packages/source/T/Twisted/Twisted-13.1.0.tar.bz2#md5=5609c91ed465f5a7da48d30a0e7b6960
Processing Twisted-13.1.0.tar.bz2
Writing /tmp/easy_install-xYafJF/Twisted-13.1.0/setup.cfg
Running Twisted-13.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xYafJF/Twisted-13.1.0/egg-dist-tmp-ybetxt
twisted/runner/portmap.c:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
我也尝试了pip install Scrapy 命令,但我再次收到相同的错误x86_64-linux-gnu-gcc
您能帮我在 Ubuntu 13.04 上安装 Scrapy 吗?
【问题讨论】:
-
是的,我得到了“gcc 版本 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)”
-
官方scrapy网站不推荐这个。 “不要使用 Ubuntu 提供的 python-scrapy 包,它们通常太旧且速度慢,无法赶上最新的 Scrapy。”
-
是的。它给出了同样的错误。 “错误:命令 'x86_64-linux-gnu-gcc' 失败,退出状态为 1” “命令 /usr/bin/python -c “import setuptools;__file__='/tmp/pip-build-brk/Twisted/setup.py ';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec') )" install --record /tmp/pip-aiQgfx-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-brk/Twisted"
-
你安装了python dev吗?
-
非常感谢。安装“python2.7-dev”后,我成功安装了Scrapy
标签: ubuntu scrapy pip easy-install