Connection error in your code?

Issue

  • Connection Error

  • DownloadWarning

If you see similar error message in your notebook, this often means that your code needs to download external resources. Compute nodes from some partitions on Mistral e.g. shared. have no Internet access. As a result, your the code will fail.

Possible solutions

  • if you are using jupyterhub @ DKRZ, try with the prepost partition

  • you can execute the suspected code from the Mistral login nodes

  • download the required resources manually

Use case

One popular use case is with cartopy, this library needs to download maps from external servers. If none of the possible solutions works, you can still download the missing resources manually. For example, when using cartopy for the first time, you will probably get the error when adding the coastlines. This how you can download and set up the maps manually (110m):

1. wget http://naciscdn.org/naturalearth/110m/physical/ne_110m_coastline.zip

2. unzip ne_110m_coastline.zip -d
~/.local/share/cartopy/shapefiles/natural_earth/physical/

3. import cartopy
   cartopy.config['data_dir'] = '~/.local/share/cartopy/'
   cartopy.config['pre_existing_data_dir'] = '~/.local/share/cartopy/'