Ubuntu 10.10 安裝Scrapy過程實錄

想了解一下spider,後來看到開源的Scrapy,因而在個人ubuntun10.10下安裝。安裝過程以下:python

沒有安裝 easy_install的先安裝,根據scrapy的文檔上安裝:sudo easy_install -U Scrapyubuntu

安裝過程當中提示scrapy

NOTE: Trying to build without Cython, pre-generated 'src/lxml/lxml.etree.c' needs to be available.
ERROR: /bin/sh: xslt-config: not found

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
src/lxml/lxml.etree.c:4: fatal error: Python.h: 沒有那個文件或目錄
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1ide

通過google查詢得知沒有安裝libxml2-dev和libxlst1-devui

爲保險起見,請依次安裝以下:google

sudo apt-get install gccxml

sudo apt-get install python-devip

sudo apt-get install libxml2 libxml2-dev文檔

sudo apt-get install libxslt1.1 libxslt1-devget

後面的是數字1,不是字母l,不要寫錯了。

而後再次運行sudo easy_install -U -Scrapy

成功。

相關文章
相關標籤/搜索