FIX six issue with module imports

Fixes #3518, #3519.

Inspired by Johannes Schönberger's patch to scikit-image,
https://github.com/scikit-image/scikit-image/commit/71743d2d6ff3666c9530278dfd650c2435fa15d9