Fix import of distutils errors and provide better messages for errors