• pyspider启动错误解决(Python 3.7)


    问题一

    安装好pyspider之后,在启动的时候,报出上图错误。

    原因

    asyncawaitpython3.7 开始已经加入保留关键字中. 参考: What’s New In Python 3.7, 所以async不能作为函数的参数名.

    解决办法

    1.打开安装Python的位置:python位置Libsite-packagespyspider

    参照地址:D:AnacondaLibsite-packagespyspider

    2.修改下列python文件中的asyncshark(全部替换)

    1. run.py
    2. fetcher ornado_fetcher.py
    3. webuiapp.py

    问题二

    管理权限打开命令窗口,运行pyspider命令,报下列错

    d:anacondalibsite-packagespyspiderlibsutils.py:196: FutureWarning: timeout is not supported on your platform.
      warnings.warn("timeout is not supported on your platform.", FutureWarning)
    [I 190504 11:20:38 result_worker:49] result_worker starting...
    phantomjs fetcher running on port 25555
    [I 190504 11:20:46 processor:211] processor starting...
    [I 190504 11:20:46 scheduler:647] scheduler starting...
    [I 190504 11:20:46 scheduler:586] in 5m: new:0,success:0,retry:0,failed:0
    [I 190504 11:20:48 tornado_fetcher:638] fetcher starting...
    [I 190504 11:20:49 scheduler:782] scheduler.xmlrpc listening on 127.0.0.1:23333
    [I 190504 11:20:51 run:420] phantomjs exited.
    [I 190504 11:20:51 app:84] webui exiting...
    [I 190504 11:20:51 tornado_fetcher:671] fetcher exiting...
    [I 190504 11:20:52 scheduler:663] scheduler exiting...
    [I 190504 11:20:52 result_worker:66] result_worker exiting...
    [I 190504 11:20:52 processor:229] processor exiting...
    Traceback (most recent call last):
      File "d:anacondalib
    unpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "d:anacondalib
    unpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "D:AnacondaScriptspyspider.exe\__main__.py", line 9, in <module>
      File "d:anacondalibsite-packagespyspider
    un.py", line 754, in main
        cli()
      File "d:anacondalibsite-packagesclickcore.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "d:anacondalibsite-packagesclickcore.py", line 697, in main
        rv = self.invoke(ctx)
      File "d:anacondalibsite-packagesclickcore.py", line 1043, in invoke
        return Command.invoke(self, ctx)
      File "d:anacondalibsite-packagesclickcore.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "d:anacondalibsite-packagesclickcore.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "d:anacondalibsite-packagesclickdecorators.py", line 17, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "d:anacondalibsite-packagespyspider
    un.py", line 165, in cli
        ctx.invoke(all)
      File "d:anacondalibsite-packagesclickcore.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "d:anacondalibsite-packagesclickdecorators.py", line 17, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "d:anacondalibsite-packagespyspider
    un.py", line 497, in all
        ctx.invoke(webui, **webui_config)
      File "d:anacondalibsite-packagesclickcore.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "d:anacondalibsite-packagesclickdecorators.py", line 17, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "d:anacondalibsite-packagespyspider
    un.py", line 384, in webui
        app.run(host=host, port=port)
      File "d:anacondalibsite-packagespyspiderwebuiapp.py", line 59, in run
        from .webdav import dav_app
      File "d:anacondalibsite-packagespyspiderwebuiwebdav.py", line 216, in <module>
        dav_app = WsgiDAVApp(config)
      File "d:anacondalibsite-packageswsgidavwsgidav_app.py", line 135, in __init__
        _check_config(config)
      File "d:anacondalibsite-packageswsgidavwsgidav_app.py", line 119, in _check_config
        raise ValueError("Invalid configuration:
      - " + "
      - ".join(errors))
    ValueError: Invalid configuration:
      - Deprecated option 'domaincontroller': use 'http_authenticator.domain_controller' instead.

    原因

    WsgiDAV发布了版本 pre-release 3.x导致

    解决办法

    降低WsgiDAV版本,命令窗口运行

    python -m pip install wsgidav==2.4.1

    管理权限打开命令窗口,运行pyspider命令,成功!

  • 相关阅读:
    CPP Info Memo part3
    在Google搜索结果显示原始链接(转自 月光博客)
    libc 之 locales
    Git 分支管理与本地 repository 创建
    py2exe issue: ImportError: No module named _fontdata_enc_winansi (http://stackoverflow.com/)
    CPP Info Memo (Part 1)
    CPP Info Memo part2
    HOWTO: Increase write speed by 'aligning' FAT32(通过对齐 FAT32 提高U盘访问速度, 转载)
    (转载)Gentoo中文man乱码
    如何选择开源许可证?(转载)
  • 原文地址:https://www.cnblogs.com/Mayfly-nymph/p/10808088.html
Copyright © 2020-2023  润新知