SyntaxError: invalid syntax
-
async和await从 python3.7 开始已经加入保留关键字中. 所以async不能作为函数的参数名.
-
修改/Library/anaconda3/lib/python3.7/site-packages/pyspider路径下的python文件中的async为shark(全部替换)
- run.py
- fetcher\tornado_fetcher.py
- webui\app.py
ValueError: Invalid configuration: - Deprecated option ‘domaincontroller’: use 'http_authenticator
- 原因是因为WsgiDAV发布了版本 pre-release 3.x。
- 解决办法 :在安装包中找到pyspider的资源包,然后找到webui文件里面的webdav.py文件打开,修改第209行即可。把
'domaincontroller': NeedAuthController(app),
修改为:
'http_authenticator':{
'HTTPAuthenticator':NeedAuthController(app),
},
然后再执行pyspider all就能够通过http://localhost:5000打开页面了。
ImportError: cannot import name ‘DispatcherMiddleware’
pip uninstall werkzeug -y # 卸载
pip install werkzeug==0.16.1 #安装0.16.1版本
或者
python -m pip uninstall werkzeug -y # 卸载
python -m pip install werkzeug==0.16.1 #安装0.16.1版本`
解决