redhat下pyspider安装

来源:互联网 发布:淘宝客新增网站推广 编辑:程序博客网 时间:2024/05/29 07:11

1、软件环境

python 2.7.1

pip已安装

linux redhat 6.5企业版

2、安装依赖

yum install libxml2  libxml2-dev libxslt-devel 

3、安装lxml

下载http://lxml.de/index.html#download

解压用python setup.py install 安装即可

4、下载pyspider源码

https://github.com/binux/pyspider/tags

解压用python setup.py install 安装即可

5、安装phantomjs2.1

前置安装:

#yum -y install gcc gcc-c++ make flex bison gperf ruby \openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel \libpng-devel libjpeg-devel

然后下载安装

#git clone git://github.com/ariya/phantomjs.git#cd phantomjs#git checkout 2.1.1#git submodule init#git submodule update#python build.py

最后 建立软链接   ln -s  /../phantomjs/bin/phantomjs /usr/bin/ 

常见问题:

一般是依赖没有安装或者版本不兼容,像python安装一般都这些问题。


ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (none/other)

解决:

pip uninstall pycurlexport PYCURL_SSL_LIBRARY=nsseasy_install pycurl


资料:

http://www.pyspider.cn/  pyspider中文网

http://docs.pyspider.org/en/latest/Quickstart/  官方

1 0
原创粉丝点击