zoukankan      html  css  js  c++  java
  • Ubuntu14.04部署pyspider的过程

    1、安装,安装官方文档,应该先执行

    1. sudo apt-get install python python-dev python-distribute python-pip libcurl4-openssl-dev libxml2-dev libxslt1-dev python-lxml  

    再执行:

    1. sudo pip install --allow-all-external pyspider[all]  

    第一个错误:

    1. No distributions at all found for mysql-connector-python>=1.2.2  

    解决方法:换pip源,给~/.pip/pip.conf里面加上:

    1. [global]  
    2. index-url = http://pypi.douban.com/simple/  

    第二个错误:

    1. Error: pg_config executable not found.  

    解决方法:

    1. sudo aptitude install libpq-dev  

    第三个错误:

        In file included from src/docstrings.c:4:0:
        src/pycurl.h:170:31: fatal error: openssl/crypto.h: No such file or directory
        compilation terminated.
        error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    解决方法:

    sudo apt-get install libssl-dev

    如果要用phantomjs,还得独立安装:

    1. sudo aptitude install phantomjs  

    建议使用MongoDB做数据存储:

    1. sudo aptitue install mongodb  

    建议使用redis做消息队列存储:

    1. sudo aptitude install redis-server  

    给个与官放文档略有不同的配置文件范本(config.json):

    1. {  
    2.  "taskdb":"mongodb+taskdb://mongodbuser:password@127.0.0.1:27017/taskdb",  
    3.  "projectdb":"mongodb+projectdb://mongodbuser:password@127.0.0.1:27017/projectdb",  
    4.  "resultdb":"mongodb+resultdb://mongodbuser:password@127.0.0.1:27017/resultdb",  
    5.  "message_queue":"redis://:redis_password@127.0.0.1:6379/1",  
    6.  "webui": {  
    7.     "username": "webUIusername",  
    8.     "password": "webUIpassword",  
    9.     "need-auth": true  
    10.   }  
    11. }  


    启动shell脚本:

    1. #!/bin/bash  
    2. sudo nohup pyspider -c config.json all &  



  • 相关阅读:
    UVA 1515 Pool construction 最大流跑最小割
    BZOJ 1060: [ZJOI2007]时态同步 树形DP
    Codeforces Round #282 (Div. 1)B. Obsessive String KMP+DP
    BZOJ 4027: [HEOI2015]兔子与樱花 贪心
    BZOJ 2435: [Noi2011]道路修建 dfs搜图
    HDU 5297 Y sequence 容斥/迭代
    HDU 5296 Annoying problem dfs序 lca set
    HDU 5289 Assignment RMQ
    343D/Codeforces Round #200 (Div. 1) D. Water Tree dfs序+数据结构
    php mysqli扩展库之预处理操作
  • 原文地址:https://www.cnblogs.com/dhcn/p/7121400.html
Copyright © 2011-2022 走看看