Index: src/sas/sasgui/perspectives/calculator/__init__.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/__init__.py	(revision 5a405bda2da663894b6b32ab94768a91d60525a4)
+++ src/sas/sasgui/perspectives/calculator/__init__.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -2,5 +2,5 @@
 import os
 from distutils.filelist import findall
-from calculator import *
+from .calculator import *
 N_DIR = 12
 def get_data_path(media):
Index: src/sas/sasgui/perspectives/calculator/collimation_editor.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/collimation_editor.py	(revision 959eb0181ad06828a748f04512f953aad5b31659)
+++ src/sas/sasgui/perspectives/calculator/collimation_editor.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -6,5 +6,5 @@
 from sas.sascalc.dataloader.loader import Loader
 from sas.sascalc.dataloader.data_info import Aperture, Collimation
-from aperture_editor import ApertureDialog
+from .aperture_editor import ApertureDialog
 
 from sas.sasgui.guiframe.utils import check_float
Index: src/sas/sasgui/perspectives/calculator/data_editor.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/data_editor.py	(revision 235f514ba93b57fa63e44309f182acef0b98bb55)
+++ src/sas/sasgui/perspectives/calculator/data_editor.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -7,7 +7,7 @@
 from sas.sascalc.dataloader.loader import Loader
 from sas.sascalc.dataloader.data_info import Data2D
-from detector_editor import DetectorDialog
-from collimation_editor import CollimationDialog
-from console import ConsoleDialog
+from .detector_editor import DetectorDialog
+from .collimation_editor import CollimationDialog
+from .console import ConsoleDialog
 
 from sas.sasgui.guiframe.events import StatusEvent
@@ -397,5 +397,5 @@
         if data is None:
             return
-        from sample_editor import SampleDialog
+        from .sample_editor import SampleDialog
         dlg = SampleDialog(parent=self, sample=data.sample)
         dlg.set_manager(self)
@@ -409,5 +409,5 @@
         if data is None:
             return
-        from source_editor import SourceDialog
+        from .source_editor import SourceDialog
         dlg = SourceDialog(parent=self, source=data.source)
         dlg.set_manager(self)
@@ -527,5 +527,5 @@
         try:
             #Load data
-            from load_thread import DataReader
+            from .load_thread import DataReader
             ## If a thread is already started, stop it
             if self.reader is not None and self.reader.isrunning():
@@ -536,5 +536,5 @@
             self.reader.queue()
         except:
-            msg = "Data Editor: %s" % (sys.exc_value)
+            msg = "Data Editor: %s" % (sys.exc_info()[1])
             load_error(msg)
             return
Index: src/sas/sasgui/perspectives/calculator/data_operator.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/data_operator.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sasgui/perspectives/calculator/data_operator.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -202,10 +202,10 @@
         else:
             text = name
-        state_list = self.get_datalist().values()
+        state_list = list(self.get_datalist().values())
         name_list = []
         for state in state_list:
             if state.data is None:
                 theory_list = state.get_theory()
-                theory, _ = theory_list.values()[0]
+                theory, _ = list(theory_list.values())[0]
                 d_name = str(theory.name)
             else:
@@ -397,5 +397,5 @@
             self._set_textctrl_color(self.data1_cbox, 'pink')
             self._set_textctrl_color(self.data2_cbox, 'pink')
-            msg = "DataOperation: %s" % sys.exc_value
+            msg = "DataOperation: %s" % sys.exc_info()[1]
             self.send_warnings(msg, 'error')
             self.output = None
@@ -411,5 +411,5 @@
         operator = self.operator_cbox.GetClientData(pos)
         try:
-            exec "output = data1 %s data2" % operator
+            exec("output = data1 %s data2" % operator)
         except:
             raise
@@ -532,5 +532,5 @@
         self.data2_cbox.SetClientData(pos3, val)
         dnames = []
-        ids = self._data.keys()
+        ids = list(self._data.keys())
         for id in ids:
             if id is not None:
@@ -539,9 +539,9 @@
                 else:
                     theory_list = self._data[id].get_theory()
-                    theory, _ = theory_list.values()[0]
+                    theory, _ = list(theory_list.values())[0]
                     dnames.append(theory.name)
         ind = np.argsort(dnames)
         if len(ind) > 0:
-            val_list = np.array(self._data.values())[ind]
+            val_list = np.array(list(self._data.values()))[ind]
             for datastate in val_list:
                 data = datastate.data
@@ -558,5 +558,5 @@
                 try:
                     theory_list = datastate.get_theory()
-                    for theory, _ in theory_list.values():
+                    for theory, _ in list(theory_list.values()):
                         th_name = theory.name
                         posth1 = self.data1_cbox.Append(str(th_name))
@@ -588,5 +588,5 @@
         self.send_warnings('')
         self.data_namectr.SetBackgroundColour('white')
-        state_list = self.get_datalist().values()
+        state_list = list(self.get_datalist().values())
         name = self.data_namectr.GetValue().strip()
         name_list = []
@@ -594,5 +594,5 @@
             if state.data is None:
                 theory_list = state.get_theory()
-                theory, _ = theory_list.values()[0]
+                theory, _ = list(theory_list.values())[0]
                 d_name = str(theory.name)
             else:
@@ -896,6 +896,6 @@
         list = []
         list = self.graph.returnPlottable()
-        if len(list.keys()) > 0:
-            first_item = list.keys()[0]
+        if len(list(list.keys())) > 0:
+            first_item = list(list.keys())[0]
             if first_item.x != []:
                 from sas.sasgui.plottools.PropertyDialog import Properties
Index: src/sas/sasgui/perspectives/calculator/density_panel.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/density_panel.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sasgui/perspectives/calculator/density_panel.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -364,5 +364,5 @@
         except:
             if self.base is not None:
-                msg = "Density/Volume Calculator: %s" % (sys.exc_value)
+                msg = "Density/Volume Calculator: %s" % (sys.exc_info()[1])
                 wx.PostEvent(self.base, StatusEvent(status=msg))
         if event is not None:
Index: src/sas/sasgui/perspectives/calculator/detector_editor.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/detector_editor.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sasgui/perspectives/calculator/detector_editor.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -1,3 +1,3 @@
-from __future__ import print_function
+
 
 import wx
@@ -35,5 +35,5 @@
             self.set_values()
         except:
-            print("error", sys.exc_value)
+            print("error", sys.exc_info()[1])
 
     def _define_structure(self):
Index: src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -3,5 +3,5 @@
 This module relies on guiframe manager.
 """
-from __future__ import print_function
+
 
 import wx
@@ -228,5 +228,5 @@
         sizer.Add(unit_title, (iy, ix), (1, 1), \
                             wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-        key_list = params.keys()
+        key_list = list(params.keys())
         key_list.sort()
         for param in key_list:
@@ -560,5 +560,5 @@
             if self.parent.parent is None:
                 return
-            msg = "Generic SAS Calculator: %s" % (sys.exc_value)
+            msg = "Generic SAS Calculator: %s" % (sys.exc_info()[1])
             wx.PostEvent(self.parent.parent,
                           StatusEvent(status=msg, type='stop'))
@@ -761,5 +761,5 @@
         # II. Plot selective points in color
         other_color = np.ones(len(pix_symbol), dtype='bool')
-        for key in color_dic.keys():
+        for key in list(color_dic.keys()):
             chosen_color = pix_symbol == key
             if np.any(chosen_color):
@@ -775,5 +775,5 @@
                 # Get atom names not in the list
                 a_names = [symb  for symb in pix_symbol \
-                           if symb not in color_dic.keys()]
+                           if symb not in list(color_dic.keys())]
                 a_name = a_names[0]
                 for name in a_names:
@@ -899,5 +899,5 @@
 
         except:
-            msg = "%s." % sys.exc_value
+            msg = "%s." % sys.exc_info()[1]
             status_type = 'stop'
             self._status_info(msg, status_type)
@@ -1285,5 +1285,5 @@
             else:
                sld_sets[list[0]] = None
-        for key in sld_sets.keys():
+        for key in list(sld_sets.keys()):
             key_low = key.lower()
             if key_low.count('mx') > 0:
@@ -1336,5 +1336,5 @@
                     return
 
-            for key in sets.keys():
+            for key in list(sets.keys()):
                 setattr(omfdata, key, sets[key])
 
@@ -1345,5 +1345,5 @@
             self.sld_data.filename = "Default SLD Profile"
         except:
-            msg = "OMF Panel: %s" % sys.exc_value
+            msg = "OMF Panel: %s" % sys.exc_info()[1]
             infor = 'Error'
             #logger.error(msg)
@@ -1375,5 +1375,5 @@
         step_list = self._get_step_key_list(omfdata)
         for ctr_list in self.nodes:
-            for key in nodes_list.keys():
+            for key in list(nodes_list.keys()):
                 if ctr_list[0] == key:
                     ctr_list[1].SetValue(format_number(nodes_list[key], True))
@@ -1381,5 +1381,5 @@
                     break
         for ctr_list in self.stepsize:
-            for key in step_list.keys():
+            for key in list(step_list.keys()):
                 if ctr_list[0] == key:
                     ctr_list[1].SetValue(format_number(step_list[key], True))
@@ -1442,5 +1442,5 @@
         sld_key_list = self._get_slds_key_list(omfdata)
         # Dic is not sorted
-        key_list = [key for key in sld_key_list.keys()]
+        key_list = [key for key in list(sld_key_list.keys())]
         # Sort here
         key_list.sort()
@@ -1485,5 +1485,5 @@
         ix = 0
         iy = -1
-        for key, value in key_list.iteritems():
+        for key, value in key_list.items():
             iy += 1
             ix = 0
@@ -1521,5 +1521,5 @@
         iy = -1
         #key_list.sort()
-        for key, value in key_list.iteritems():
+        for key, value in key_list.items():
             iy += 1
             ix = 0
@@ -1641,5 +1641,5 @@
         sld_list = self._get_slds_key_list(sld_data)
         for ctr_list in self.slds:
-            for key in sld_list.keys():
+            for key in list(sld_list.keys()):
                 if ctr_list[0] == key:
                     min_val = np.min(sld_list[key])
Index: src/sas/sasgui/perspectives/calculator/image_viewer.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/image_viewer.py	(revision 412e9e8b8f844bae61656ffb2a2d0c1c53e6e8de)
+++ src/sas/sasgui/perspectives/calculator/image_viewer.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -1,3 +1,3 @@
-from __future__ import print_function
+
 
 import os
Index: src/sas/sasgui/perspectives/calculator/kiessig_calculator_panel.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/kiessig_calculator_panel.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sasgui/perspectives/calculator/kiessig_calculator_panel.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -14,6 +14,6 @@
 from sas.sasgui.guiframe.panel_base import PanelBase
 from sas.sascalc.calculator.kiessig_calculator import KiessigThicknessCalculator
-from calculator_widgets import OutputTextCtrl
-from calculator_widgets import InputTextCtrl
+from .calculator_widgets import OutputTextCtrl
+from .calculator_widgets import InputTextCtrl
 from sas.sasgui.perspectives.calculator import calculator_widgets as widget
 from sas.sasgui.guiframe.documentation_window import DocumentationWindow
Index: src/sas/sasgui/perspectives/calculator/model_editor.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/model_editor.py	(revision 23359ccb520c33d89444d0732d752a3bc0226916)
+++ src/sas/sasgui/perspectives/calculator/model_editor.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -23,5 +23,5 @@
 #copyright 2009, University of Tennessee
 ################################################################################
-from __future__ import print_function
+
 
 import wx
@@ -790,5 +790,5 @@
             if item.count("_") < 1:
                 try:
-                    exec "float(math.%s)" % item
+                    exec("float(math.%s)" % item)
                     self.math_combo.Append(str(item))
                 except Exception:
Index: src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py	(revision 01cda57b9e14ce69f0153005140f08837b90f28e)
+++ src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -148,5 +148,5 @@
         # Custom sorting
         source_list = []
-        for key, _ in self.source_mass.iteritems():
+        for key, _ in self.source_mass.items():
             name_source = str(key)
             source_list.append(name_source)
@@ -1082,5 +1082,5 @@
                 msg = "The numbers must be one or two (separated by ',')..."
                 self._status_info(msg, 'stop')
-                raise RuntimeError, msg
+                raise RuntimeError(msg)
 
         return new_string
@@ -1100,5 +1100,5 @@
                 new_string.append(value)
             except:
-                logger.error(sys.exc_value)
+                logger.error(sys.exc_info()[1])
 
         return new_string
@@ -1142,5 +1142,5 @@
                         return out
                 except:
-                    logger.error(sys.exc_value)
+                    logger.error(sys.exc_info()[1])
 
     def _on_xy_coordinate(self, event=None):
@@ -1269,5 +1269,5 @@
             try:
                 basename = os.path.basename(path)
-                if basename not in self.spectrum_dic.keys():
+                if basename not in list(self.spectrum_dic.keys()):
                     self.spectrum_cb.Append(basename)
                 self.spectrum_dic[basename] = self._read_file(path)
@@ -1320,5 +1320,5 @@
                 except:
                     # Skip non-data lines
-                    logger.error(sys.exc_value)
+                    logger.error(sys.exc_info()[1])
 
             return [wavelength, intensity]
Index: src/sas/sasgui/perspectives/calculator/sld_panel.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/sld_panel.py	(revision fe09e9bb0ad6caa9284d13a5c7dfdfc420d0c28b)
+++ src/sas/sasgui/perspectives/calculator/sld_panel.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -366,5 +366,5 @@
         if len(myformula.atoms) != 1:
             return
-        element = myformula.atoms.keys()[0]
+        element = list(myformula.atoms.keys())[0]
         energy = xray_energy(element.K_alpha)
 
@@ -450,5 +450,5 @@
         if len(element_formula.atoms) != 1:
             return
-        element = element_formula.atoms.keys()[0]
+        element = list(element_formula.atoms.keys())[0]
         energy = xray_energy(element.K_alpha)
         atom = molecule_formula.atoms
@@ -507,5 +507,5 @@
         except:
             if self.base is not None:
-                msg = "SLD Calculator: %s" % (sys.exc_value)
+                msg = "SLD Calculator: %s" % (sys.exc_info()[1])
                 wx.PostEvent(self.base, StatusEvent(status=msg))
         if event is not None:
Index: src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -17,6 +17,6 @@
 from sas.sasgui.guiframe.events import StatusEvent
 from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator
-from calculator_widgets import OutputTextCtrl
-from calculator_widgets import InterActiveOutputTextCtrl
+from .calculator_widgets import OutputTextCtrl
+from .calculator_widgets import InterActiveOutputTextCtrl
 from sas.sasgui.perspectives.calculator import calculator_widgets as widget
 from sas.sasgui.guiframe.documentation_window import DocumentationWindow
@@ -210,5 +210,5 @@
         try:
             #Load data
-            from load_thread import DataReader
+            from .load_thread import DataReader
             ## If a thread is already started, stop it
             if self.reader is not None and self.reader.isrunning():
@@ -226,5 +226,5 @@
             if self.parent.parent is None:
                 return
-            msg = "Slit Length Calculator: %s" % (sys.exc_value)
+            msg = "Slit Length Calculator: %s" % (sys.exc_info()[1])
             wx.PostEvent(self.parent.parent,
                           StatusEvent(status=msg, type='stop'))
@@ -262,5 +262,5 @@
             if x == [] or  x is None or y == [] or y is None:
                 msg = "The current data is empty please check x and y"
-                raise ValueError, msg
+                raise ValueError(msg)
             slit_length_calculator = SlitlengthCalculator()
             slit_length_calculator.set_data(x=x, y=y)
@@ -269,5 +269,5 @@
             if self.parent.parent is None:
                 return
-            msg = "Slit Size Calculator: %s" % (sys.exc_value)
+            msg = "Slit Size Calculator: %s" % (sys.exc_info()[1])
             wx.PostEvent(self.parent.parent,
                           StatusEvent(status=msg, type='stop'))
