当我尝试使用命令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吗?
答案 0 :(得分:17)
对我来说,我安装了python dev但仍然无法正常工作(尝试安装加密时失败)并且我发现this堆栈溢出帖子说运行此命令以保证所有依赖项都已安装
sudo apt-get install build-essential libssl-dev libffi-dev python-dev libxml2-dev
这对我有用
答案 1 :(得分:12)
为了安装scrapy,你需要先安装python dev。
答案 2 :(得分:3)
使用此: sudo apt-get install libssl-dev
安装scrapy之前。 然后
sudo pip install scrapy --force --upgrade
答案 3 :(得分:1)
我在尝试在DigitalOcean Droplet上安装Scrapy时遇到了完全相同的问题,这不是库问题,显然它可能发生在低RAM盒中,你可以通过组合ionice + pip解决它:
sudo ionice -c3 pip install Scrapy