- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有没有办法在 Jupyter 笔记本中使用以下代码行启动 Dash 仪表板?
# if __name__ == '__main__':
# app.run_server(debug=True)
当我尝试启动此程序时,出现错误。
纠正它的唯一方法是将 debug 设置为 false。但是,当图表中的数据发生更改时,仪表板不会自动更新。
最佳答案
编辑
我刚刚发现一位有值(value)的 GitHub 用户发布了 following library 。这是相应 repo 的直接链接。请参阅他的文档和示例,以在 jupyter 中成功实现它。它对我有用。
在安装库之前不要低估这句话:“强烈建议使用 virtualenv 环境”!
原帖
我自己前段时间也遇到过这个问题。我不知道现在是否已原生修复。我当时使用的解决方法就是这个。它直接来自 Chris 本人,但仍然有 debug = False
:
from IPython import display
def show_app(app, # type: dash.Dash
port=9999,
width=700,
height=350,
offline=True,
style=True,
**dash_flask_kwargs):
"""
Run the application inside a Jupyter notebook and show an iframe with it
:param app:
:param port:
:param width:
:param height:
:param offline:
:return:
"""
url = 'http://localhost:%d' % port
iframe = '<iframe src="{url}" width={width} height={height}></iframe>'.format(url=url,
width=width,
height=height)
display.display_html(iframe, raw=True)
if offline:
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True
if style:
external_css = ["https://fonts.googleapis.com/css?family=Raleway:400,300,600",
"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css",
"http://getbootstrap.com/dist/css/bootstrap.min.css", ]
for css in external_css:
app.css.append_css({"external_url": css})
external_js = ["https://code.jquery.com/jquery-3.2.1.min.js",
"https://cdn.rawgit.com/plotly/dash-app-stylesheets/a3401de132a6d0b652ba11548736b1d1e80aa10d/dash-goldman-sachs-report-js.js",
"http://getbootstrap.com/dist/js/bootstrap.min.js"]
for js in external_js:
app.scripts.append_script({"external_url": js})
return app.run_server(debug=False, # needs to be false in Jupyter
port=port,
**dash_flask_kwargs)
那么这样使用对你来说就是回调函数的切换吗?请展示你的程序的一些逻辑。也许我可以提供更多提示。干杯。
关于python - 从 Jupyter Notebook 启动 Dash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55478173/
我不断收到以下消息:“自上次打开或保存笔记本文件以来,磁盘上的笔记本文件已更改。您想用此处打开的版本覆盖磁盘上的文件,还是加载磁盘上的版本(重新加载页面) )?”在 Jupyter 笔记本上,即使我没
让我们假设,我想打开一个笔记本(即使用我的本地 Jupyter 实例),但我不想用它启动关联的内核(即 Python)。我怎样才能做到这一点? 可能的用例: 我只想从以前的计算中获得笔记本输出。我不想
在将 IPython 笔记本转换为笔记本时,我试图隐藏一些特定的单元格。我想在类里面使用笔记本,并希望从包含问题和答案的主笔记本生成“练习”笔记本。 This post非常有帮助,但由于某种原因,使用
在过去的几个小时里,我一直在试图弄清楚如何将我的 Jupyter Notebook 下载为 pdf。我已经下载了 MiKTeX 并重新安装了 anaconda。下面的完整错误 500内部服务器错误 错
我想要一个完整的文件作为文本文件,而不仅仅是 IPython 笔记本中的一个单元格。 我在 IPython notebook 中写了一些代码,现在我想测试它们,所以我尝试将一些文本文件作为原始数据上传
我在我的办公室电脑上工作,由于安全限制不允许我安装程序(比如 miktex,....)。所以我决定将我的笔记本导出为 .html。 如您所见,渲染效果不佳: 一些代码被删减了 很多空间被破坏了,有很大
如何在终端中编辑我的 jupyter notebook。我只是不喜欢在网络浏览器中打开 jupyter notebook。我用谷歌搜索,但每个答案都与我们如何直接从终端打开笔记本有关。 最佳答案 我建
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
我正在使用 Julia,但并不是很喜欢 IDE(更像是一个笔记本电脑)。所以我第一次使用 Jupyter(实验室和笔记本)。 我从 Anaconda 启动了 Jupyter 并制作了我的笔记本。问题是
我试图用 ipython notebook 在终端中打开 ipython它不会打开 ipython notebook。它给出了以下错误: | ~/documents/ud120-projects/da
尝试从终端启动 jupyter notebook。我目前在正确文件夹中的终端上,并且安装了 python 3.5 和 conda。但它没有启动。 最佳答案 Jupyter Notebooks 允许您打
我有 plotly plotly 的 jupyter 笔记本不会保留 session 之间的 plotly 。 这是在基于官方 jupyter/datascience-notebook docker
我试过使用 pip3 install jupyter 安装 jupyter notebook。每次我启动一个新的 jupyter notebook 时,notebook 都无法连接到内核。请参阅下面的
我懂代码,懂 Markdown。 我已阅读 this Raw cells article ,但看不出太多。 什么是深奥的 NBConvert ? 请投点灯。 最佳答案 更新的文档位于 https://
运行代码后,我可以自动将笔记本保存为HTML。但是,有时结果生成速度太快,因此输出HTML在最后一个单元格中没有输出。 我想知道是否可以告诉文件进行自我保存? 就像是 # In last cell c
我在最近安装了 anaconda 的虚拟机中运行 Ubuntu 14.04。我使用 conda 安装了 jupyter 笔记本。我已经按照我可以在网上找到的所有文档来安装笔记本扩展,但它们无法加载并显
我正在使用 nbconvert通过命令行执行 iPython notebook(如 this answer ): ipython nbconvert --to=html --ExecutePrepro
除了原始 Jupyter Notebook 文件(.ipynb 文件)之外,有时我还会得到一个检查点 .ipynb 文件,该文件似乎直接链接到原始 。 ipynb 文件。 这些检查点文件的用途是什么?
我使用 ssh -L 连接到远程服务器,但如果我合上笔记本电脑盖子或连接丢失,jupyter 笔记本就会断开连接。 重新连接到远程服务器后,“最后一个” session 丢失。 如何才能使其持久?sc
Jupyter 笔记本支持 Markdown 单元格,但它似乎不支持表情符号代码。我想一种方法可能是使用 html 导入图标,如 fontawesome 有人有解决方法吗? 编辑:直接在 jupyte
我是一名优秀的程序员,十分优秀!