Index: src/sas/sasgui/perspectives/fitting/__init__.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/__init__.py	(revision 12d3e0e31a7f9e8d72d50e8ad904316b003a6bea)
+++ src/sas/sasgui/perspectives/fitting/__init__.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -1,5 +1,5 @@
 PLUGIN_ID = "Fitting plug-in 1.0"
 import os
-from fitting import *
+from .fitting import *
 from distutils.filelist import findall
 def get_data_path(media):
Index: src/sas/sasgui/perspectives/fitting/basepage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/basepage.py	(revision 3bd677bda9477bbd07235d9fba448f09ae1b3932)
+++ src/sas/sasgui/perspectives/fitting/basepage.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -2,5 +2,5 @@
 Base Page for fitting
 """
-from __future__ import print_function
+
 
 import sys
@@ -12,5 +12,5 @@
 import logging
 import traceback
-from Queue import Queue
+from queue import Queue
 from threading import Thread
 from collections import defaultdict
@@ -223,5 +223,5 @@
         self.popUpMenu = wx.Menu()
 
-        wx_id = self._ids.next()
+        wx_id = next(self._ids)
         self._keep = wx.MenuItem(self.popUpMenu, wx_id, "Add bookmark",
                                  " Keep the panel status to recall it later")
@@ -623,5 +623,5 @@
         if self.model is not None:
             self.m_name = self.model.name
-        if name in self.saved_states.keys():
+        if name in list(self.saved_states.keys()):
             previous_state = self.saved_states[name]
             # reset state of checkbox,textcrtl  and  regular parameters value
@@ -918,5 +918,5 @@
 
         if len(self._disp_obj_dict) > 0:
-            for k, v in self._disp_obj_dict.iteritems():
+            for k, v in self._disp_obj_dict.items():
                 self.state.disp_obj_dict[k] = v.type
 
@@ -985,5 +985,5 @@
 
             if len(self.disp_cb_dict) > 0:
-                for k, v in self.disp_cb_dict.iteritems():
+                for k, v in self.disp_cb_dict.items():
                     if v is None:
                         self.state.disp_cb_dict[k] = v
@@ -994,5 +994,5 @@
                             self.state.disp_cb_dict[k] = None
             if len(self._disp_obj_dict) > 0:
-                for k, v in self._disp_obj_dict.iteritems():
+                for k, v in self._disp_obj_dict.items():
                     self.state.disp_obj_dict[k] = v.type
 
@@ -1096,5 +1096,5 @@
             if name == "ArrayDispersion":
 
-                for item in self.disp_cb_dict.keys():
+                for item in list(self.disp_cb_dict.keys()):
 
                     if hasattr(self.disp_cb_dict[item], "SetValue"):
@@ -1167,5 +1167,5 @@
         :return: combo_box_position
         """
-        for key, value in self.master_category_dict.iteritems():
+        for key, value in self.master_category_dict.items():
             formfactor = state.formfactorcombobox.split(":")
             if isinstance(formfactor, list):
@@ -1219,5 +1219,5 @@
         # select the current model
         state._convert_to_sasmodels()
-        state.categorycombobox = unicode(state.categorycombobox)
+        state.categorycombobox = str(state.categorycombobox)
         if state.categorycombobox in self.categorybox.Items:
             category_pos = self.categorybox.Items.index(
@@ -1244,5 +1244,5 @@
         structfactor_pos = 0
         if state.structurecombobox is not None:
-            state.structurecombobox = unicode(state.structurecombobox)
+            state.structurecombobox = str(state.structurecombobox)
             for ind_struct in range(self.structurebox.GetCount()):
                 if (self.structurebox.GetString(ind_struct)
@@ -1354,5 +1354,5 @@
         self.weights = copy.deepcopy(state.weights)
 
-        for key, disp_type in state.disp_obj_dict.iteritems():
+        for key, disp_type in state.disp_obj_dict.items():
             # disp_model = disp
             disp_model = POLYDISPERSITY_MODELS[disp_type]()
@@ -1415,8 +1415,8 @@
         """
         ids = iter(self._id_pool)  # Reusing ids for context menu
-        for name, _ in self.state.saved_states.iteritems():
+        for name, _ in self.state.saved_states.items():
             self.number_saved_state += 1
             # Add item in the context menu
-            wx_id = ids.next()
+            wx_id = next(ids)
             msg = 'Save model and state %g' % self.number_saved_state
             self.popUpMenu.Append(wx_id, name, msg)
@@ -2314,5 +2314,5 @@
                     value_ctrl.SetValue(format_number(value))
 
-                if name not in self.model.details.keys():
+                if name not in list(self.model.details.keys()):
                     self.model.details[name] = ["", None, None]
                 old_low, old_high = self.model.details[name][1:3]
@@ -2675,8 +2675,8 @@
         if disp_func is not None:
             try:
-                return POLYDISPERSITY_MODELS.values().index(disp_func.__class__)
+                return list(POLYDISPERSITY_MODELS.values()).index(disp_func.__class__)
             except ValueError:
                 pass  # Fall through to default class
-        return POLYDISPERSITY_MODELS.keys().index('gaussian')
+        return list(POLYDISPERSITY_MODELS.keys()).index('gaussian')
 
     def on_reset_clicked(self, event):
@@ -2770,5 +2770,5 @@
         gui_manager = self._manager.parent
         # loops through the panels [dic]
-        for _, item2 in gui_manager.plot_panels.iteritems():
+        for _, item2 in gui_manager.plot_panels.items():
             data_title = self.data.group_id
             # try to get all plots belonging to this control panel
@@ -3340,5 +3340,5 @@
             if self.data.__class__.__name__ == "Data2D":
                 name = item[1]
-                if name in content.keys():
+                if name in list(content.keys()):
                     values = content[name]
                     check = values[0]
@@ -3389,5 +3389,5 @@
                 if not item[1] in orient_param:
                     name = item[1]
-                    if name in content.keys():
+                    if name in list(content.keys()):
                         check = content[name][0]
                         # Avoid changing combox content
@@ -3615,15 +3615,15 @@
         sizer_cat = wx.BoxSizer(wx.HORIZONTAL)
         self.mbox_description.SetForegroundColour(wx.RED)
-        wx_id = self._ids.next()
+        wx_id = next(self._ids)
         self.model_func = wx.Button(self, wx_id, 'Help', size=(80, 23))
         self.model_func.Bind(wx.EVT_BUTTON, self.on_function_help_clicked,
                              id=wx_id)
         self.model_func.SetToolTipString("Full Model Function Help")
-        wx_id = self._ids.next()
+        wx_id = next(self._ids)
         self.model_help = wx.Button(self, wx_id, 'Description', size=(80, 23))
         self.model_help.Bind(wx.EVT_BUTTON, self.on_model_help_clicked,
                              id=wx_id)
         self.model_help.SetToolTipString("Short Model Function Description")
-        wx_id = self._ids.next()
+        wx_id = next(self._ids)
         self.model_view = wx.Button(self, wx_id, "Show 2D", size=(80, 23))
         self.model_view.Bind(wx.EVT_BUTTON, self._onModel2D, id=wx_id)
Index: src/sas/sasgui/perspectives/fitting/fit_thread.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fit_thread.py	(revision ba8d326f0f4ceb55c77296a9b5af8bd013c7dd92)
+++ src/sas/sasgui/perspectives/fitting/fit_thread.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -11,5 +11,5 @@
 
 def map_apply(arguments):
-    return apply(arguments[0], arguments[1:])
+    return arguments[0](*arguments[1:])
 
 class FitThread(CalcThread):
@@ -49,5 +49,5 @@
         except KeyboardInterrupt:
             msg = "Fitting: terminated by the user."
-            raise KeyboardInterrupt, msg
+            raise KeyboardInterrupt(msg)
 
     def compute(self):
@@ -72,8 +72,8 @@
                 list_map_get_attr.append(map_getattr)
             #from multiprocessing import Pool
-            inputs = zip(list_map_get_attr, self.fitter, list_fit_function,
+            inputs = list(zip(list_map_get_attr, self.fitter, list_fit_function,
                          list_q, list_q, list_handler, list_curr_thread,
-                         list_reset_flag)
-            result = map(map_apply, inputs)
+                         list_reset_flag))
+            result = list(map(map_apply, inputs))
 
             self.complete(result=result,
@@ -84,5 +84,5 @@
                           elapsed=time.time() - self.starttime)
 
-        except KeyboardInterrupt, msg:
+        except KeyboardInterrupt as msg:
             # Thread was interrupted, just proceed and re-raise.
             # Real code should not print, but this is an example...
Index: src/sas/sasgui/perspectives/fitting/fitpage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpage.py	(revision 3bd677bda9477bbd07235d9fba448f09ae1b3932)
+++ src/sas/sasgui/perspectives/fitting/fitpage.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -281,5 +281,5 @@
 
         # Fit button
-        self.btFit = wx.Button(self, self._ids.next(), 'Fit')
+        self.btFit = wx.Button(self, next(self._ids), 'Fit')
         self.default_bt_colour = self.btFit.GetDefaultAttributes()
         self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id=self.btFit.GetId())
@@ -377,5 +377,5 @@
 
         # Update and Draw button
-        self.draw_button = wx.Button(self, self._ids.next(), 'Compute')
+        self.draw_button = wx.Button(self, next(self._ids), 'Compute')
         self.draw_button.Bind(wx.EVT_BUTTON,
                               self._onDraw, id=self.draw_button.GetId())
@@ -532,5 +532,5 @@
         self.qmin.Bind(wx.EVT_TEXT, self.on_qrange_text)
         self.qmax.Bind(wx.EVT_TEXT, self.on_qrange_text)
-        wx_id = self._ids.next()
+        wx_id = next(self._ids)
         self.reset_qrange = wx.Button(self, wx_id, 'Reset')
 
@@ -540,5 +540,5 @@
         sizer = wx.GridSizer(5, 5, 2, 6)
 
-        self.btEditMask = wx.Button(self, self._ids.next(), 'Editor')
+        self.btEditMask = wx.Button(self, next(self._ids), 'Editor')
         self.btEditMask.Bind(wx.EVT_BUTTON, self._onMask,
                              id=self.btEditMask.GetId())
@@ -660,5 +660,5 @@
         self.text_disp_min.Show(True)
 
-        for item in self.model.dispersion.keys():
+        for item in list(self.model.dispersion.keys()):
             if not self.magnetic_on:
                 if item in self.model.magnetic_params:
@@ -675,5 +675,5 @@
 
                 iy += 1
-                for p in self.model.dispersion[item].keys():
+                for p in list(self.model.dispersion[item].keys()):
 
                     if p == "width":
@@ -765,5 +765,5 @@
                 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1),
                                        style=wx.CB_READONLY, name='%s' % name1)
-                for key, value in POLYDISPERSITY_MODELS.iteritems():
+                for key, value in POLYDISPERSITY_MODELS.items():
                     name_disp = str(key)
                     disp_box.Append(name_disp, value)
@@ -779,5 +779,5 @@
                           wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         first_orient = True
-        for item in self.model.dispersion.keys():
+        for item in list(self.model.dispersion.keys()):
             if not self.magnetic_on:
                 if item in self.model.magnetic_params:
@@ -795,5 +795,5 @@
 
                 iy += 1
-                for p in self.model.dispersion[item].keys():
+                for p in list(self.model.dispersion[item].keys()):
 
                     if p == "width":
@@ -929,5 +929,5 @@
                 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1),
                                 style=wx.CB_READONLY, name='%s' % name1)
-                for key, value in POLYDISPERSITY_MODELS.iteritems():
+                for key, value in POLYDISPERSITY_MODELS.items():
                     name_disp = str(key)
                     disp_box.Append(name_disp, value)
@@ -1370,5 +1370,5 @@
             except:
                 tcrtl.SetBackgroundColour("pink")
-                msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                msg = "Model Error:wrong value entered : %s" % sys.exc_info()[1]
                 wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
@@ -1482,10 +1482,10 @@
                 else:
                     tcrtl.SetBackgroundColour("pink")
-                    msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                    msg = "Model Error:wrong value entered : %s" % sys.exc_info()[1]
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                     return
             except:
                 tcrtl.SetBackgroundColour("pink")
-                msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                msg = "Model Error:wrong value entered : %s" % sys.exc_info()[1]
                 wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
@@ -1733,5 +1733,5 @@
         ind = 0
         while(ind < len(list)):
-            for key, val in list.items():
+            for key, val in list(list.items()):
                 if val == ind:
                     fun_box.Append(key, val)
@@ -1865,5 +1865,5 @@
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg,
                                                info="error"))
-                    raise ValueError, msg
+                    raise ValueError(msg)
 
             else:
@@ -1877,5 +1877,5 @@
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg,
                                                info="error"))
-                    raise ValueError, msg
+                    raise ValueError(msg)
                 # Maximum value of data
                 qmax = math.sqrt(x * x + y * y)
@@ -2118,5 +2118,5 @@
         self._on_fit_complete()
         if out is None or not np.isfinite(chisqr):
-            raise ValueError, "Fit error occured..."
+            raise ValueError("Fit error occured...")
 
         is_modified = False
@@ -2193,5 +2193,5 @@
                 i += 1
             else:
-                raise ValueError, "onsetValues: Invalid parameters..."
+                raise ValueError("onsetValues: Invalid parameters...")
         # Show error title when any errors displayed
         if has_error:
@@ -2951,6 +2951,6 @@
 
         # type can be either Guassian or Array
-        if len(self.model.dispersion.values()) > 0:
-            type = self.model.dispersion.values()[0]["type"]
+        if len(list(self.model.dispersion.values())) > 0:
+            type = list(self.model.dispersion.values())[0]["type"]
         else:
             type = "Gaussian"
Index: src/sas/sasgui/perspectives/fitting/fitpanel.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpanel.py	(revision c9ecd1b562e38798001341ea1382b347f0cc1af9)
+++ src/sas/sasgui/perspectives/fitting/fitpanel.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -94,5 +94,5 @@
             batch_state = self.sim_page.set_state()
 
-        for uid, page in self.opened_pages.iteritems():
+        for uid, page in self.opened_pages.items():
             data = page.get_data()
             # state must be cloned
@@ -135,5 +135,5 @@
         if uid not in self.opened_pages:
             msg = "Fitpanel cannot find ID: %s in self.opened_pages" % str(uid)
-            raise ValueError, msg
+            raise ValueError(msg)
         else:
             return self.opened_pages[uid]
@@ -217,5 +217,5 @@
         page_is_opened = False
         if state is not None:
-            for uid, panel in self.opened_pages.iteritems():
+            for uid, panel in self.opened_pages.items():
                 # Don't return any panel is the exact same page is created
                 if uid == panel.uid and panel.data == state.data:
@@ -396,7 +396,7 @@
         """
         if data.__class__.__name__ != "list":
-            raise ValueError, "Fitpanel delete_data expect list of id"
+            raise ValueError("Fitpanel delete_data expect list of id")
         else:
-            for page in self.opened_pages.values():
+            for page in list(self.opened_pages.values()):
                 pos = self.GetPageIndex(page)
                 temp_data = page.get_data()
@@ -433,5 +433,5 @@
                 data_2d_list.append(data)
         page = None
-        for p in self.opened_pages.values():
+        for p in list(self.opened_pages.values()):
             # check if there is an empty page to fill up
             if not check_data_validity(p.get_data()) and p.batch_on:
@@ -503,5 +503,5 @@
                 return None
         focused_page = self.GetPage(self.GetSelection())
-        for page in self.opened_pages.values():
+        for page in list(self.opened_pages.values()):
             # check if the selected data existing in the fitpanel
             pos = self.GetPageIndex(page)
@@ -592,5 +592,5 @@
         if selected_page in page_finder:
             # Delete the name of the page into the list of open page
-            for uid, list in self.opened_pages.iteritems():
+            for uid, list in self.opened_pages.items():
                 # Don't return any panel is the exact same page is created
                 if flag and selected_page.uid == uid:
@@ -600,5 +600,5 @@
 
         # Delete the name of the page into the list of open page
-        for uid, list in self.opened_pages.iteritems():
+        for uid, list in self.opened_pages.items():
             # Don't return any panel is the exact same page is created
             if selected_page.uid == uid:
Index: src/sas/sasgui/perspectives/fitting/fitproblem.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitproblem.py	(revision 251ef68424c8f373dfb82af3c159086491c5f975)
+++ src/sas/sasgui/perspectives/fitting/fitproblem.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -309,5 +309,5 @@
         self._smear_on = flag
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.enable_smearing(flag)
         elif fid in self:
@@ -320,5 +320,5 @@
         """
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.set_smearer(smearer)
         elif fid in self:
@@ -336,5 +336,5 @@
         """
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.save_model_name(name)
         elif fid in self:
@@ -346,5 +346,5 @@
         result = []
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 result.append(value.get_name())
         elif fid in self:
@@ -360,5 +360,5 @@
         self.model = model
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.set_model(self.model)
         elif fid in self:
@@ -456,5 +456,5 @@
         """
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.set_model_param(name, value)
         elif fid in self:
@@ -486,5 +486,5 @@
         """
         self.scheduled = schedule
-        for value in self.values():
+        for value in list(self.values()):
             value.schedule_tofit(schedule)
 
@@ -502,5 +502,5 @@
         self.qmax = qmax
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.set_range(self.qmin, self.qmax)
         elif fid in self:
@@ -519,5 +519,5 @@
         """
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.set_weight(flag=flag, is2d=is2d)
         elif fid in self:
@@ -536,5 +536,5 @@
         """
         if fid is None:
-            for value in self.values():
+            for value in list(self.values()):
                 value.clear_model_param()
         elif fid in self:
@@ -545,5 +545,5 @@
         return fitproblem contained in this dictionary
         """
-        return self.values()
+        return list(self.values())
 
     def set_result(self, result, fid):
Index: src/sas/sasgui/perspectives/fitting/fitting.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitting.py	(revision 9706d88b71e719f590147b9914149630bce2f1d2)
+++ src/sas/sasgui/perspectives/fitting/fitting.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -11,5 +11,5 @@
 #copyright 2009, University of Tennessee
 ################################################################################
-from __future__ import print_function
+
 
 import re
@@ -142,5 +142,5 @@
         Given an ID create a fitproblem container
         """
-        if page_id in self.page_finder.iterkeys():
+        if page_id in iter(self.page_finder.keys()):
             del self.page_finder[page_id]
 
@@ -335,5 +335,5 @@
             if temp:
                 # Set the new plugin model list for all fit pages
-                for uid, page in self.fit_panel.opened_pages.iteritems():
+                for uid, page in self.fit_panel.opened_pages.items():
                     if hasattr(page, "formfactorbox"):
                         page.model_list_box = temp
@@ -350,5 +350,5 @@
                                 page.formfactorbox.SetLabel(current_val)
         except:
-            logger.error("update_custom_combo: %s", sys.exc_value)
+            logger.error("update_custom_combo: %s", sys.exc_info()[1])
 
     def set_edit_menu(self, owner):
@@ -556,5 +556,5 @@
         else:
             if len(data_list) > MAX_NBR_DATA:
-                from fitting_widgets import DataDialog
+                from .fitting_widgets import DataDialog
                 dlg = DataDialog(data_list=data_list, nb_data=MAX_NBR_DATA)
                 if dlg.ShowModal() == wx.ID_OK:
@@ -576,5 +576,5 @@
                         self.add_fit_page(data=[data])
             except:
-                msg = "Fitting set_data: " + str(sys.exc_value)
+                msg = "Fitting set_data: " + str(sys.exc_info()[1])
                 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error"))
 
@@ -590,5 +590,5 @@
                 msg = "Fitting: cannot deal with the theory received"
                 evt = StatusEvent(status=msg, info="error")
-                logger.error("set_theory " + msg + "\n" + str(sys.exc_value))
+                logger.error("set_theory " + msg + "\n" + str(sys.exc_info()[1]))
                 wx.PostEvent(self.parent, evt)
 
@@ -602,5 +602,5 @@
         """
         from pagestate import PageState
-        from simfitpage import SimFitPageState
+        from .simfitpage import SimFitPageState
         if isinstance(state, PageState):
             state = state.clone()
@@ -713,5 +713,5 @@
         if fid is None:
             return
-        if uid in self.page_finder.keys():
+        if uid in list(self.page_finder.keys()):
             self.page_finder[uid].set_weight(flag=flag, is2d=is2d)
 
@@ -726,5 +726,5 @@
         :param qmax: maximum  value of the fit range
         """
-        if uid in self.page_finder.keys():
+        if uid in list(self.page_finder.keys()):
             self.page_finder[uid].set_range(qmin=qmin, qmax=qmax, fid=fid)
 
@@ -737,5 +737,5 @@
         :param uid: the id related to a page contaning fitting information
         """
-        if uid in self.page_finder.keys():
+        if uid in list(self.page_finder.keys()):
             self.page_finder[uid].schedule_tofit(value)
 
@@ -756,5 +756,5 @@
         """
         sim_page_id = self.sim_page.uid
-        for uid, value in self.page_finder.iteritems():
+        for uid, value in self.page_finder.items():
             if uid != sim_page_id and uid != self.batch_page.uid:
                 model_list = value.get_model()
@@ -821,5 +821,5 @@
         Stop the fit
         """
-        if uid in self.fit_thread_list.keys():
+        if uid in list(self.fit_thread_list.keys()):
             calc_fit = self.fit_thread_list[uid]
             if calc_fit is not  None and calc_fit.isrunning():
@@ -833,7 +833,7 @@
         batch_flag = self.batch_page is not None and uid == self.batch_page.uid
         if sim_flag or batch_flag:
-            for uid, value in self.page_finder.iteritems():
+            for uid, value in self.page_finder.items():
                 if value.get_scheduled() == 1:
-                    if uid in self.fit_panel.opened_pages.keys():
+                    if uid in list(self.fit_panel.opened_pages.keys()):
                         panel = self.fit_panel.opened_pages[uid]
                         panel._on_fit_complete()
@@ -852,5 +852,5 @@
         :param draw: Determine if the theory needs to be plot
         """
-        if uid not in self.page_finder.keys():
+        if uid not in list(self.page_finder.keys()):
             return
         self.page_finder[uid].enable_smearing(flag=enable_smearer)
@@ -964,5 +964,5 @@
         list_page_id = []
         fit_id = 0
-        for page_id, page_info in self.page_finder.iteritems():
+        for page_id, page_info in self.page_finder.items():
             # For simulfit (uid give with None), do for-loop
             # if uid is specified (singlefit), do it only on the page.
@@ -991,5 +991,5 @@
 
                     pars = [str(element[1]) for element in page.param_toFit]
-                    fitproblem_list = page_info.values()
+                    fitproblem_list = list(page_info.values())
                     for fitproblem in  fitproblem_list:
                         if sim_fitter is None:
@@ -1013,5 +1013,5 @@
             except:
                 raise
-                msg = "Fitting error: %s" % str(sys.exc_value)
+                msg = "Fitting error: %s" % str(sys.exc_info()[1])
                 evt = StatusEvent(status=msg, info="error", type="stop")
                 wx.PostEvent(self.parent, evt)
@@ -1070,5 +1070,5 @@
         :param fid: the id of the fitproblem(data, model, range,etc)
         """
-        if uid not in self.page_finder.keys():
+        if uid not in list(self.page_finder.keys()):
             return
         fitproblemList = self.page_finder[uid].get_fit_problem(fid)
@@ -1116,5 +1116,5 @@
                 wx.PostEvent(self.parent, evt)
         except:
-            msg = "Creating Fit page: %s" % sys.exc_value
+            msg = "Creating Fit page: %s" % sys.exc_info()[1]
             wx.PostEvent(self.parent, StatusEvent(status=msg, info="error"))
 
@@ -1196,9 +1196,9 @@
         # case that uid is not specified
         if uid is None:
-            for page_id in self.page_finder.keys():
+            for page_id in list(self.page_finder.keys()):
                 self.page_finder[page_id].schedule_tofit(value)
         # when uid is given
         else:
-            if uid in self.page_finder.keys():
+            if uid in list(self.page_finder.keys()):
                 self.page_finder[uid].schedule_tofit(value)
 
@@ -1234,5 +1234,5 @@
         panel = self.plot_panel
         if panel is None:
-            raise ValueError, "Fitting:_onSelect: NonType panel"
+            raise ValueError("Fitting:_onSelect: NonType panel")
         Plugin.on_perspective(self, event=event)
         self.select_data(panel)
@@ -1267,5 +1267,5 @@
         """
         uid = page_id[0]
-        if uid in self.fit_thread_list.keys():
+        if uid in list(self.fit_thread_list.keys()):
             del self.fit_thread_list[uid]
 
@@ -1293,16 +1293,16 @@
                 #get all fittable parameters of the current model
                 for param in  model.getParamList():
-                    if param  not in batch_outputs.keys():
+                    if param  not in list(batch_outputs.keys()):
                         batch_outputs[param] = []
                 for param in model.getDispParamList():
                     if not model.is_fittable(param) and \
-                        param in batch_outputs.keys():
+                        param in list(batch_outputs.keys()):
                         del batch_outputs[param]
                 # Add fitted parameters and their error
                 for param in res.param_list:
-                    if param not in batch_outputs.keys():
+                    if param not in list(batch_outputs.keys()):
                         batch_outputs[param] = []
                     err_param = "error on %s" % str(param)
-                    if err_param not in batch_inputs.keys():
+                    if err_param not in list(batch_inputs.keys()):
                         batch_inputs[err_param] = []
         msg = ""
@@ -1389,5 +1389,5 @@
                 #model
                 EMPTY = "-"
-                for key in batch_outputs.keys():
+                for key in list(batch_outputs.keys()):
                     if key not in param_list and key not in ["Chi2", "Data"]:
                         batch_outputs[key].append(EMPTY)
@@ -1432,5 +1432,5 @@
         tbatch_outputs = {}
         shownkeystr = cpage.get_copy_params()
-        for key in batch_outputs.keys():
+        for key in list(batch_outputs.keys()):
             if key in ["Chi2", "Data"] or shownkeystr.count(key) > 0:
                 tbatch_outputs[key] = batch_outputs[key]
@@ -1452,5 +1452,5 @@
         model = fitproblem.get_model()
         #fill batch result information
-        if "Data" not in batch_outputs.keys():
+        if "Data" not in list(batch_outputs.keys()):
             batch_outputs["Data"] = []
         from sas.sasgui.guiframe.data_processor import BatchCell
@@ -1482,6 +1482,6 @@
         cell.object = [data, theory_data]
         batch_outputs["Data"].append(cell)
-        for key, value in data.meta_data.iteritems():
-            if key not in batch_inputs.keys():
+        for key, value in data.meta_data.items():
+            if key not in list(batch_inputs.keys()):
                 batch_inputs[key] = []
             #if key.lower().strip() != "loader":
@@ -1489,5 +1489,5 @@
         param = "temperature"
         if hasattr(data.sample, param):
-            if param not in  batch_inputs.keys():
+            if param not in  list(batch_inputs.keys()):
                 batch_inputs[param] = []
             batch_inputs[param].append(data.sample.temperature)
@@ -1562,5 +1562,5 @@
         except:
             msg = ("Fit completed but the following error occurred: %s"
-                   % sys.exc_value)
+                   % sys.exc_info()[1])
             #import traceback; msg = "\n".join((traceback.format_exc(), msg))
             evt = StatusEvent(status=msg, info="warning", type="stop")
@@ -1650,5 +1650,5 @@
         if model is None:
             return
-        if uid not in self.page_finder.keys():
+        if uid not in list(self.page_finder.keys()):
             return
         # save the name containing the data name with the appropriate model
@@ -1903,5 +1903,5 @@
             return None
         try:
-            from model_thread import Calc2D
+            from .model_thread import Calc2D
             ## If a thread is already started, stop it
             if (self.calc_2D is not None) and self.calc_2D.isrunning():
@@ -1950,5 +1950,5 @@
             return
         try:
-            from model_thread import Calc1D
+            from .model_thread import Calc1D
             ## If a thread is already started, stop it
             if (self.calc_1D is not None) and self.calc_1D.isrunning():
@@ -1989,5 +1989,5 @@
         except:
             msg = " Error occurred when drawing %s Model 1D: " % model.name
-            msg += " %s" % sys.exc_value
+            msg += " %s" % sys.exc_info()[1]
             wx.PostEvent(self.parent, StatusEvent(status=msg))
 
Index: src/sas/sasgui/perspectives/fitting/model_thread.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/model_thread.py	(revision 0f9ea1cee80a92f71e4bec65998ca56a3de65fd6)
+++ src/sas/sasgui/perspectives/fitting/model_thread.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -65,5 +65,5 @@
         if self.data is None:
             msg = "Compute Calc2D receive data = %s.\n" % str(self.data)
-            raise ValueError, msg
+            raise ValueError(msg)
 
         # Define matrix where data will be plotted
Index: src/sas/sasgui/perspectives/fitting/simfitpage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/simfitpage.py	(revision 0a3c740de7a24dad98e912cdeee179e382e3839a)
+++ src/sas/sasgui/perspectives/fitting/simfitpage.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -168,5 +168,5 @@
         i = 0
         for model in self.model_list:
-            model_id = self._format_id(model[1].keys()[0])
+            model_id = self._format_id(list(model[1].keys())[0])
             for saved_model in sim_state.model_list:
                 save_id = saved_model.pop('name')
@@ -195,8 +195,8 @@
                 param = item.pop('param_cbox')
                 equality = item.pop('egal_txt')
-                for key, value in init_map.items():
+                for key, value in list(init_map.items()):
                     model_cbox = model_cbox.replace(key, value)
                     constraint_value = constraint_value.replace(key, value)
-                for key, value in final_map.items():
+                for key, value in list(final_map.items()):
                     model_cbox = model_cbox.replace(key, value)
                     constraint_value = constraint_value.replace(key, value)
@@ -328,5 +328,5 @@
         sizer.Add(tab_used, (iy, ix), (1, 1),
                   wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-        for id, value in self.page_finder.iteritems():
+        for id, value in self.page_finder.items():
             if id not in self.parent.opened_pages:
                 continue
@@ -757,10 +757,10 @@
         self.set_button.Disable()
 
-        for id, model in self.constraint_dict.iteritems():
+        for id, model in self.constraint_dict.items():
             # check if all parameters have been selected for constraint
             # then do not allow add constraint on parameters
             self.model_cbox_left.Append(str(model.name), model)
         self.model_cbox_left.Select(0)
-        for id, model in self.constraint_dict.iteritems():
+        for id, model in self.constraint_dict.items():
             # check if all parameters have been selected for constraint
             # then do not allow add constraint on parameters
@@ -814,5 +814,5 @@
         model_right = self.model_cbox_right.GetValue()
         model_b = self.model_cbox_right.GetClientData(selection_b)
-        for id, dic_model in self.constraint_dict.iteritems():
+        for id, dic_model in self.constraint_dict.items():
             if model == dic_model:
                 param_list = self.page_finder[id].get_param2fit()
@@ -857,5 +857,5 @@
         if len(self.constraints_list) != 0:
             nb_fit_param = 0
-            for id, model in self.constraint_dict.iteritems():
+            for id, model in self.constraint_dict.items():
                 nb_fit_param += len(self.page_finder[id].get_param2fit())
             # Don't add anymore
@@ -879,5 +879,5 @@
         model_cbox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY)
         model_cbox.Clear()
-        for id, model in self.constraint_dict.iteritems():
+        for id, model in self.constraint_dict.items():
             # check if all parameters have been selected for constraint
             # then do not allow add constraint on parameters
@@ -898,5 +898,5 @@
         # Remove button
         #btRemove = wx.Button(self, self.ID_REMOVE, 'Remove')
-        bt_remove = wx.Button(self, self._ids.next(), 'Remove')
+        bt_remove = wx.Button(self, next(self._ids), 'Remove')
         bt_remove.Bind(wx.EVT_BUTTON, self.on_remove,
                       id=bt_remove.GetId())
@@ -931,5 +931,5 @@
         hide buttons related constraint
         """
-        for id in self.page_finder.iterkeys():
+        for id in self.page_finder.keys():
             self.page_finder[id].clear_model_param()
 
@@ -969,5 +969,5 @@
         model = model_cbox.GetClientData(n)
         param_list = []
-        for id, dic_model in self.constraint_dict.iteritems():
+        for id, dic_model in self.constraint_dict.items():
             if model == dic_model:
                 param_list = self.page_finder[id].get_param2fit()
@@ -1056,5 +1056,5 @@
                 msg += " in combobox to set constraint! "
                 wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
-            for id, value in self.constraint_dict.iteritems():
+            for id, value in self.constraint_dict.items():
                 if model == value:
                     if constraint == "":
@@ -1080,5 +1080,5 @@
                         return False
 
-                    for fid in self.page_finder[id].iterkeys():
+                    for fid in self.page_finder[id].keys():
                         # wrap in param/constraint in str() to remove unicode
                         self.page_finder[id].set_model_param(str(param),
