1、安装,安装官方文档,应该先执行
sudo apt-get install python python-dev python-distribute python-pip libcurl4-openssl-dev libxml2-dev libxslt1-dev python-lxml再执行:
sudo pip install --allow-all-external pyspider[all]
第一个错误:
No distributions at all found for mysql-connector-python>=1.2.2解决方法:换pip源,给~/.pip/pip.conf里面加上:
[global] index-url = http://pypi.douban.com/simple/第二个错误:
Error: pg_config executable not found.解决方法:
sudo aptitude install libpq-dev如果要用phantomjs,还得独立安装:
sudo aptitude install phantomjs
建议使用mongodb做数据存储:
sudo aptitue install mongodb建议使用redis做消息队列存储:
sudo aptitude install redis-server
给个与官放文档略有不同的配置文件范本(config.json):
{ "taskdb":"mongodb+taskdb://mongodbuser:[email protected]:27017/taskdb", "projectdb":"mongodb+projectdb://mongodbuser:[email protected]:27017/projectdb", "resultdb":"mongodb+resultdb://mongodbuser:[email protected]:27017/resultdb", "message_queue":"redis://:[email protected]:6379/1", "webui": { "username": "webUIusername", "password": "webUIpassword", "need-auth": true } }
#!/bin/bash sudo nohup pyspider -c config.json all &