0
herokuでbokeh appを実行したい。例として、私はこのwebsiteから取った次のコードを与えることができます。だから、requirement.txt herokuでbokehアプリケーションを実行する
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で説明する手順を実行する必要があり、ということがわかりました。
ただし、bokehを使用する場合はrequirements.txtファイルに何を追加する必要がありますかここに記載されていません。ヒーローでbokeh appを実行するために必要なこのことや他のことについて私を助けることができる人はいますか?
「requirements.txt」ファイルを作成する最も簡単な方法は、 'pip freeze> requirements.txt'です。プロジェクトごとのvirtualenvを使用しない場合、実際には必要のないものがたくさん含まれていることに注意してください。 – jonrsharpe
また、 'conda'を使用している場合、' conda list --export'を実行できますが、要件のごく短いリストも以下に示します。 – bigreddot