分類: 從錯中學
500 – internal server error
ERROR
以 pandas_datareader 和 bokeh 製作股價 K 線圖時
在 Localhost 運作正常
但部屬到 Heroku 上時就會出現 internal server error
Heroku Logs
File "/app/script1.py", line 67, in plot css_url = CDN.css_files[0] IndexError: list index out of range
顯然問題是出在
css_url = CDN.css_files[0]
解決辦法
在 jupyter notebook 上確實要抓第一個 index 才是正確的 CSS 連結
但把 [0] 刪掉後就不會出現 500 error
css_url = CDN.css_files
2017.8.30 Errors
“break" ouside the loop
break 不能用來中止 if statement,而是中止 Loop
unindent does not match any outer indentation level
新的 python 語法中,代碼縮進 (indentation) 不支援 Tab 和 Space 混用
name ‘raw_input’ is not defined
python 3 只需要 ‘input‘ 即可,沒有 ‘raw_input’