防止 Plotly Dash 中出现循环依赖 UI 错误消息
Prevent Circular Dependencies UI error message in Plotly Dash
我的 Dash 程序中有递归元素,它们处理得很好,永远不会有无限递归的风险。
不幸的是,我的应用程序上弹出一个框,告诉我我有一个递归。如何停止显示此警告?
在主函数调用中将debug
更改为False
if __name__ == '__main__':
app.run_server(debug=False)
可以抑制关于循环依赖的 Dash 消息。它由传递给 dash-renderer 内的 DepGraph() 函数的“循环”参数控制。我遇到了同样的问题,通过在 Python 的 site-packages/dash_renderer 目录中打开 dash_renderer.min.js,搜索“DepGraph”,并替换字符串“this.circular=e&&!! e.circular" by "this.circular=true" 就在通话中。
帖子 here and here.
引导我找到了这个解决方案
我在使用两个回调时看到错误:一个将元素的 'value' 作为 input/output,第二个仅将 'value' 作为输出。当我实现 second-callback 时发生错误,当我将输入从第一个输入更改为 'state' 时错误消失了——也许这对任何人都有帮助。
我的 Dash 程序中有递归元素,它们处理得很好,永远不会有无限递归的风险。 不幸的是,我的应用程序上弹出一个框,告诉我我有一个递归。如何停止显示此警告?
在主函数调用中将debug
更改为False
if __name__ == '__main__':
app.run_server(debug=False)
可以抑制关于循环依赖的 Dash 消息。它由传递给 dash-renderer 内的 DepGraph() 函数的“循环”参数控制。我遇到了同样的问题,通过在 Python 的 site-packages/dash_renderer 目录中打开 dash_renderer.min.js,搜索“DepGraph”,并替换字符串“this.circular=e&&!! e.circular" by "this.circular=true" 就在通话中。 帖子 here and here.
引导我找到了这个解决方案我在使用两个回调时看到错误:一个将元素的 'value' 作为 input/output,第二个仅将 'value' 作为输出。当我实现 second-callback 时发生错误,当我将输入从第一个输入更改为 'state' 时错误消失了——也许这对任何人都有帮助。