Configuring Jupyter Timeout

If you are running a Jupyter notebook with a long-running cell, you may encounter the following error:

[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

This indicates that the cell caused Jupyter to timeout. You can avoid this by configuring a longer timeout. Here's how to do it in the pre-setup script of a custom environment definition:

echo "c.ExecutePreprocessor.timeout = $SECONDS" >> /home/ubuntu/.ipython/profile_default/
chown ubuntu:ubuntu /home/ubuntu/.ipython/profile_default/

Substitute an appropriate value for $SECONDS. Note the chown command - this is needed because the pre-setup script runs as the root user, so the file ownership must be changed back to the ubuntu user in order to avoid a permissions error during your run.  Keep in mind this is for batch runs.

Was this article helpful?
1 out of 1 found this helpful