Could not import extension sphinxcontrib.spelling (exception: cannot import name xmlrpc_client)

While attempting to get sphinx to build the documentation for Imbo, I ran into the error message “Could not import extension sphinxcontrib.spelling (exception: cannot import name xmlrpc_client)”. I had just installed sphinxcontrib.spelling, so I had assumed it would pick up any dependencies – apparently not.

The python xmlrpc_client module name comes from the six library, a library to help write code that works on both python2 and python3. The library was installed, but apparently Ubuntu had an older version available, where xmlrpc_client wasn’t available.

Solution: Update six manually with pip:

sudo pip install --upgrade six