try:
    from .qt import QtGui as _QtGui
except ImportError as e:
    raise ImportError('Viewer requires Qt')

from .viewers import ImageViewer, CollectionViewer

import warnings
try:
    from .viewers import ImageViewer, CollectionViewer
except ImportError as e:
    warnings.warn('Viewer requires Qt')

Allow viewer package to import without Qt
Allow viewer package to import without Qt

+ import warnings
  try:
-     from .qt import QtGui as _QtGui
+     from .viewers import ImageViewer, CollectionViewer
  except ImportError as e:
-     raise ImportError('Viewer requires Qt')
+     warnings.warn('Viewer requires Qt')
  
- from .viewers import ImageViewer, CollectionViewer
- 
Allow viewer package to import without Qt
## Code Before:
try:
    from .qt import QtGui as _QtGui
except ImportError as e:
    raise ImportError('Viewer requires Qt')

from .viewers import ImageViewer, CollectionViewer

## Instruction:
Allow viewer package to import without Qt
## Code After:
import warnings
try:
    from .viewers import ImageViewer, CollectionViewer
except ImportError as e:
    warnings.warn('Viewer requires Qt')
