TypeError : required field "type_ignores" missing from Module

运行proxypool项目

启动webApi服务

python proxyPool.py server

错误信息

(proxy_pool1) D:proxy_pool>python proxyPool.py server

****************************************************************
*** ______  ********************* ______ *********** _  ********
*** | ___ \_ ******************** | ___  ********* | | ********
*** | |_/ / \__ __   __  _ __   _ | |_/ /___ * ___  | | ********
*** |  __/|  _// _   / /| | | ||  __// _  / _  | | ********
*** | |   | | | (_) | >  <  |_| || |  | (_) | (_) || |___  ****
*** \_|   |_|  \___/ /_/\_ \__  |\_|   \___/ \___/ \_____/ ****
****                       __ / /                          *****
************************* /___ / *******************************
*************************       ********************************
****************************************************************

2021-05-20 17:12:17,550 launcher.py[line:45] INFO ProxyPool Version: 2.2.0
2021-05-20 17:12:17,550 launcher.py[line:50] INFO ProxyPool configure HOST: 0.0.0.0
2021-05-20 17:12:17,551 launcher.py[line:51] INFO ProxyPool configure PORT: 5010
2021-05-20 17:12:17,551 launcher.py[line:52] INFO ProxyPool configure DB_CONN: redis://127.0.0.1:6379/0
2021-05-20 17:12:17,554 launcher.py[line:53] INFO ProxyPool configure PROXY_FETCHER: ['freeProxy01', 'freeProxy02', 'freeProxy03', 'freeProxy04', 'freeProxy05', 'freeProxy06', 'freeProxy
07', 'freeProxy08', 'freeProxy09', 'freeProxy13', 'freeProxy14']
2021-05-20 17:12:17,578 launcher.py[line:59] INFO ============ DATABASE CONFIGURE ================
2021-05-20 17:12:17,578 launcher.py[line:60] INFO DB_TYPE: REDIS
2021-05-20 17:12:17,578 launcher.py[line:61] INFO DB_HOST: 127.0.0.1
2021-05-20 17:12:17,578 launcher.py[line:62] INFO DB_PORT: 6379
2021-05-20 17:12:17,579 launcher.py[line:63] INFO DB_NAME: 0
2021-05-20 17:12:17,579 launcher.py[line:64] INFO DB_USER: None
2021-05-20 17:12:17,579 launcher.py[line:65] INFO =================================================
Traceback (most recent call last):
  File "proxyPool.py", line 42, in <module>
    cli()
  File "D:Virtualenvsproxy_pool1libsite-packagesclickcore.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "D:Virtualenvsproxy_pool1libsite-packagesclickcore.py", line 717, in main
    rv = self.invoke(ctx)
  File "D:Virtualenvsproxy_pool1libsite-packagesclickcore.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:Virtualenvsproxy_pool1libsite-packagesclickcore.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:Virtualenvsproxy_pool1libsite-packagesclickcore.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "proxyPool.py", line 38, in server
    startServer()
  File "D:proxy_poolhelperlauncher.py", line 25, in startServer
    from api.proxyApi import runFlask
  File "D:proxy_poolapiproxyApi.py", line 27, in <module>
    app = Flask(__name__)
  File "D:Virtualenvsproxy_pool1libsite-packagesflaskapp.py", line 556, in __init__
    self.add_url_rule(
  File "D:Virtualenvsproxy_pool1libsite-packagesflaskapp.py", line 64, in wrapper_func
    return f(self, *args, **kwargs)
  File "D:Virtualenvsproxy_pool1libsite-packagesflaskapp.py", line 1214, in add_url_rule
    self.url_map.add(rule)
  File "D:Virtualenvsproxy_pool1libsite-packageswerkzeug
outing.py", line 1386, in add
    rule.bind(self)
  File "D:Virtualenvsproxy_pool1libsite-packageswerkzeug
outing.py", line 730, in bind
    self.compile()
  File "D:Virtualenvsproxy_pool1libsite-packageswerkzeug
outing.py", line 794, in compile
    self._build = self._compile_builder(False).__get__(self, None)
  File "D:Virtualenvsproxy_pool1libsite-packageswerkzeug
outing.py", line 945, in _compile_builder
    code = compile(module, "<werkzeug routing>", "exec")
TypeError: required field "type_ignores" missing from Module

报错原因

python3.8的版本与werkzeug包的冲突

解决方式

  # 进入上方报错的最后一行的文件 routing.py中
  File "D:Virtualenvsproxy_pool1libsite-packageswerkzeug
outing.py", line 945, in _compile_builder
    code = compile(module, "<werkzeug routing>", "exec")

重新执行,运行成功

ps:摘自
https://www.jianshu.com/p/95588bf4e63d

原文地址:https://www.cnblogs.com/cnblogswilliam/p/14790864.html