Use six.moves.urllib.parse instead of the urlparse module.