64位Ubuntu 安装scrapy遇到的问题

这两天准备开始学习Python爬虫,安装scrapy框架后出现
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 7, in
from scrapy.cmdline import execute
File "/usr/local/lib/python2.7/dist-packages/scrapy/init.py", line 56, in
from scrapy.spider import Spider
File "/usr/local/lib/python2.7/dist-packages/scrapy/spider.py", line 7, in
from scrapy.http import Request
File "/usr/local/lib/python2.7/dist-packages/scrapy/http/init.py", line 11, in
from scrapy.http.request.form import FormRequest
File "/usr/local/lib/python2.7/dist-packages/scrapy/http/request/form.py", line 9, in
import lxml.html
File "/usr/local/lib/python2.7/dist-packages/lxml-3.3.3-py2.7-linux-i686.egg/lxml/html/init.py", line 42, in
from lxml import etree
ImportError: /usr/local/lib/python2.7/dist-packages/lxml-3.3.3-py2.7-linux-i686.egg/lxml/etree.so: wrong ELF class: ELFCLASS32

发现lxml模块在64位下没有安装好,折腾了一下午,最后看到http://www.cnblogs.com/ifantastic/p/3830707.html这篇文章才给安装好。

先更新安装依赖包:
$sudo apt-get build-dep python-lxml

再重新用pip安装就可以了
$ sudo pip install lxml --upgrade

posted @ 2014-09-27 19:08  nan86150  阅读(687)  评论(0编辑  收藏  举报