GAミント至上主義

Web Monomaniacal Developer.

jupyter nbconvertでERROR | Timeout waiting for execute reply回避

Google Cloud Datalabでjupyter nbconvertコマンドを使って日次レポートをメールで送っているけど、内容が増えるにつれ、時間がかかるようになってタイムアウトエラーで異常終了していた。

[NbConvertApp] Converting notebook /content/datalab/Daily/daily.ipynb to html
[NbConvertApp] Executing notebook with kernel: python2
[NbConvertApp] ERROR | Timeout waiting for execute reply (30s).
                If your cell should take longer than this, you can increase the timeout with:

                    c.ExecutePreprocessor.timeout = SECONDS

                in jupyter_nbconvert_config.py


Googleの配布しているDatalabのDockerで動かしているので、config変更は面倒なので、コマンドオプションで探してみると見つかった

github.com


nbconvertにオプション追加で、反映された。

あんまり長くしすぎても問題起きそうなので、10分程度にした

jupyter nbconvert --ExecutePreprocessor.timeout=600