我想在heroku上运行一个bokeh应用程序。作为一个例子,我可以给出我从这个website获取的以下代码。在
import numpy as np
from numpy import pi
from bokeh.client import push_session
from bokeh.driving import cosine
from bokeh.plotting import figure, curdoc
x = np.linspace(0, 4*pi, 80)
y = np.sin(x)
p = figure()
r1 = p.line([0, 4*pi], [-1, 1], color="firebrick")
r2 = p.line(x, y, color="navy", line_width=4)
# open a session to keep our local document in sync with server
session = push_session(curdoc())
@cosine(w=0.03)
def update(step):
# updating a single column of the the *same length* is OK
r2.data_source.data["y"] = y * step
r2.glyph.line_alpha = 1 - 0.8 * abs(step)
curdoc().add_periodic_callback(update, 50)
session.show(p) # open the document in a browser
session.loop_until_closed() # run forever
所以,要在heroku上运行这个,我发现,我需要执行answer中解释的步骤。在
但是,这里或其他地方没有说明我应该在要求.txt当我使用bokeh时归档。在heroku上运行bokeh应用程序时,有没有人可以帮我解决这个问题和其他需要做的事情?在
Bokeh的运行时需求列表非常短。它们在项目setup.py中给出:
有一些可选的依赖关系。
bokeh.charts
依赖于Pandas,使用自定义扩展依赖于安装nodej(通过conda
或其他方式)相关问题 更多 >
编程相关推荐