zoukankan      html  css  js  c++  java
  • python3.7与pyspider的坑

    网络上安装pyspider的坑有很多,但都不如我今天的大,困扰了我几天,终于解决了

    Traceback (most recent call last):
      File "/ffk_learn/software/Python-3.7.0/ffk_py/bin/pyspider", line 7, in <module>
        from pyspider.run import main
      File "/ffk_learn/software/Python-3.7.0/ffk_py/lib/python3.7/site-packages/pyspider/run.py", line 231
        async=True, get_object=False, no_input=False):
            ^
    SyntaxError: invalid syntax

    一直抱着个错误,后来才发现,是因为async从python3.7开始不能用作参数名了,将所有脚本里面的async换一个名字即可,当然最好还是要pyspider的大佬更新下pyspider.脚本不多,一共两个脚本

    1 ffk_py/lib/python3.7/site-packages/pyspider/run.py

    2 ffk_py/lib/python3.7/site-packages/pyspider/fetcher/tornado_fetcher.py 

    ValueError: Invalid configuration: - Deprecated option 'domaincontroller': use 'http_authenticator

    安装完爬虫框架pyspider之后,使用pyspider all 命令,输入http://localhost:5000运行就出现上述错误

    原因是因为WsgiDAV发布了版本 pre-release 3.x。

    解决方法如下:

    在安装包中找到pyspider的资源包,然后找到webui文件里面的webdav.py文件打开,修改第209行即可。

    'domaincontroller': NeedAuthController(app),

    修改为:

    'http_authenticator':{
            'HTTPAuthenticator':NeedAuthController(app),
        },

    然后再执行pyspider all就能够通过http://localhost:5000打开页面了。

  • 相关阅读:
    CF459E Pashmak and Graph
    cf478D Red-Green Towers
    cf255C Almost Arithmetical Progression
    准备做,但是还没做的
    CF219C hoosing Capital for Treeland
    最小中间和
    【NO.9】jmeter
    【设计用例】站内信
    【有意思的BUG】客户端无厘头 已连网的场景初始化太慢 未连网的场景异常崩溃
    禅道BUG系统
  • 原文地址:https://www.cnblogs.com/liugp/p/10859237.html
Copyright © 2011-2022 走看看