Bokeh新版本与pytrendline不兼容,旧版本安装失败求助
使用pytrendline绘制趋势线遇到的兼容性问题
运行代码时的属性错误
尝试用pytrendline在图表上绘制趋势线,运行代码时触发以下错误:
AttributeError: unexpected attribute 'render_mode' to Label, similar attributes are renderers
推测是Bokeh新版本与pytrendline库不兼容导致。注意到pytrendline的requirements.txt中要求bokeh>=2.0.2,但当前高版本Bokeh运行时却报错。
安装低版本Bokeh时的元数据生成错误
尝试安装低版本Bokeh来解决兼容性问题,却遇到如下错误:
error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [18 lines of output] C:\Users\PC\AppData\Local\Temp\pip-install-oovgz6l1\bokeh_959f180cab584b209ab3c3fc3f796765\versioneer.py:419: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "C:\Users\PC\AppData\Local\Temp\pip-install-oovgz6l1\bokeh_959f180cab584b209ab3c3fc3f796765\setup.py", line 108, in <module> version=versioneer.get_version(), ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\Temp\pip-install-oovgz6l1\bokeh_959f180cab584b209ab3c3fc3f796765\versioneer.py", line 1478, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\Temp\pip-install-oovgz6l1\bokeh_959f180cab584b209ab3c3fc3f796765\versioneer.py", line 1410, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\Temp\pip-install-oovgz6l1\bokeh_959f180cab584b209ab3c3fc3f796765\versioneer.py", line 340, in get_config_from_root ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'? [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
疑问
- 是否只能通过conda安装低版本Python来解决问题?
- 为什么pytrendline要求
bokeh>=2.0.2,但高版本Bokeh反而无法正常运行?
内容的提问来源于stack exchange,提问作者Doge
相关产品推荐
相关产品推荐

