python3.6+版本安装pyspider报错解决方案)
python3.6+版本安装pyspider报错解决方案
- 安装
- 问题集合
- async=True, get_object=False, no_input=False):
- ImportError
libcurl link-time ssl backend (openssl) is different from compile-time ssl back
- ValueError: Invalid configuration: - Deprecated option ‘domaincontroller’: use ‘http_authenticatorl
- ImportError: cannot import name ‘DispatcherMiddleware’ from ‘werkzeug.wsgi’
- 完成
安装
# 也可能是pip3,根据具体情况而定
pip install pyspider
pyspider官网
问题集合
async=True, get_object=False, no_input=False):
报错详情:
async=True, get_object=False, no_input=False):
^
SyntaxError: invalid syntax
原因分析 python3.6之后async已作为保留字段,不可作为自定义变量使用。
解决方式:
用vscode工具打开/usr/local/lib/python3.7/site-packages/pyspider 目录。全局搜索替换async变量为is_async
ImportError
libcurl link-time ssl backend (openssl) is different from compile-time ssl back
首先尝试重新安装解决
pip uninstall pycurl
export PYCURL_SSL_LIBRARY=openssl
pip install pycurl
重新安装还是无法解决,在高版本的mac系统环境变量里是找不到openssl的头文件的
pip uninstall pycurl# 卸载库
export PYCURL_SSL_LIBRARY=openssl
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include# openssl相关头文件路径
pip install pycurl --compile --no-cache-dir# 重新编译安装
ValueError: Invalid configuration: - Deprecated option ‘domaincontroller’: use ‘http_authenticatorl
原因是因为WsgiDAV发布了版本 pre-release 3.x。
解决方法如下:
在安装包中找到pyspider的资源包,然后找到webui文件里面的webdav.py文件打开,修改第209行即可。
# 'domaincontroller': NeedAuthController(app),
'http_authenticator':{
'HTTPAuthenticator': NeedAuthController(app),
},
或者降低wsgidav版本
ImportError: cannot import name ‘DispatcherMiddleware’ from ‘werkzeug.wsgi’
#卸载
python -m pip uninstall werkzeug
#安装指定版本
python -m pip install werkzeug==0.16.0
还没有评论,来说两句吧...