Don't import optional packages until needed.
This avoids failures on static python builds because of these optional packages that are not present.
This avoids failures on static python builds because of these optional packages that are not present.