Index: doc/conf.py
===================================================================
--- doc/conf.py	(revision 0496031792ca0787ae1d64698074bab7e3b6afce)
+++ doc/conf.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -22,5 +22,5 @@
 sys.path.insert(0, os.path.abspath('_extensions'))
 sys.path.insert(0, os.path.abspath('.')) # needed for extension tests
-print "\n".join(sys.path)
+print("\n".join(sys.path))
 import sasmodels
 
Index: doc/gentoc.py
===================================================================
--- doc/gentoc.py	(revision 7bb290c023a5380c0dbdd211a4aec8925839e3da)
+++ doc/gentoc.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -1,2 +1,4 @@
+from __future__ import print_function
+
 import sys
 # make sure sasmodels is on the path
@@ -39,5 +41,5 @@
 def _maybe_make_category(category, models, cat_files, model_toc):
     if category not in cat_files:
-        print >>sys.stderr, "Unexpected category %s containing"%category, models
+        print("Unexpected category %s containing"%category, models, file=sys.stderr)
         title = category.capitalize()+" Functions"
         cat_files[category] = _make_category(category, category, title, model_toc)
@@ -45,5 +47,5 @@
 def generate_toc(model_files):
     if not model_files:
-        print >>sys.stderr, "gentoc needs a list of model files"
+        print("gentoc needs a list of model files", file=sys.stderr)
 
     # find all categories
@@ -55,5 +57,5 @@
         model_definition = load_model_definition(model_name)
         if not hasattr(model_definition, 'category'):
-            print >>sys.stderr, "Missing category for",item
+            print("Missing category for", item, file=sys.stderr)
         else:
             category.setdefault(model_definition.category,[]).append(model_name)
@@ -62,5 +64,5 @@
     for k,v in category.items():
         if len(v) == 1:
-            print >>sys.stderr, "Category %s contains only %s"%(k,v[0])
+            print("Category %s contains only %s"%(k,v[0]), file=sys.stderr)
 
     # Generate category files for the table of contents.
Index: sasmodels/bumps_model.py
===================================================================
--- sasmodels/bumps_model.py	(revision 0e9048fc51455645fd5530e83ead6393f51bbf74)
+++ sasmodels/bumps_model.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -122,5 +122,5 @@
             fixed_pars = [getattr(self.model, p).value for p in self._fn.fixed_pars]
             pd_pars = [self._get_weights(p) for p in self._fn.pd_pars]
-            #print fixed_pars,pd_pars
+            #print(fixed_pars,pd_pars)
             Iq_calc = self._fn(fixed_pars, pd_pars, self.cutoff)
             #self._theory[:] = self._fn.eval(pars, pd_pars)
@@ -137,10 +137,10 @@
 
     def residuals(self):
-        #if np.any(self.err ==0): print "zeros in err"
+        #if np.any(self.err ==0): print("zeros in err")
         return (self.theory() - self.Iq) / self.dIq
 
     def nllf(self):
         delta = self.residuals()
-        #if np.any(np.isnan(R)): print "NaN in residuals"
+        #if np.any(np.isnan(R)): print("NaN in residuals")
         return 0.5 * np.sum(delta ** 2)
 
Index: sasmodels/compare.py
===================================================================
--- sasmodels/compare.py	(revision 1ec7efae85123485e3f2162d8df336b601bb13a8)
+++ sasmodels/compare.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -71,7 +71,7 @@
     """
     # convert model parameters from sasmodel form to sasview form
-    #print "old",sorted(pars.items())
+    #print("old",sorted(pars.items()))
     modelname, pars = revert_model(model_definition, pars)
-    #print "new",sorted(pars.items())
+    #print("new",sorted(pars.items()))
     sas = __import__('sas.models.'+modelname)
     ModelClass = getattr(getattr(sas.models,modelname,None),modelname,None)
@@ -193,7 +193,7 @@
     try:
         model = core.load_model(model_definition, dtype=dtype, platform="ocl")
-    except Exception,exc:
-        print exc
-        print "... trying again with single precision"
+    except Exception as exc:
+        print(exc)
+        print("... trying again with single precision")
         model = core.load_model(model_definition, dtype='single', platform="ocl")
     calculator = DirectModel(data, model, cutoff=cutoff)
@@ -267,5 +267,5 @@
         seed = int(opt_values['-random']) if '-random' in opt_values else None
         pars, seed = randomize_model(pars, seed=seed)
-        print "Randomize using -random=%i"%seed
+        print("Randomize using -random=%i"%seed)
     pars.update(set_pars)  # set value after random to control value
     constrain_pars(model_definition, pars)
@@ -275,5 +275,5 @@
         suppress_pd(pars)
     if '-pars' in opts:
-        print "pars",parlist(pars)
+        print("pars "+str(parlist(pars)))
 
     # Base calculation
@@ -287,7 +287,7 @@
             base, base_time = eval_sasview(model_definition, pars, data, Ncomp)
             base_name = "sasview"
-            #print "base/sasview", (base-pars['background'])/(comp-pars['background'])
-            print "sasview t=%.1f ms, intensity=%.0f"%(base_time, sum(base))
-            #print "sasview",comp
+            #print("base/sasview", (base-pars['background'])/(comp-pars['background']))
+            print("sasview t=%.1f ms, intensity=%.0f"%(base_time, sum(base)))
+            #print("sasview",comp)
         except ImportError:
             traceback.print_exc()
@@ -297,7 +297,7 @@
                                     dtype=dtype, cutoff=cutoff, Nevals=Nbase)
         base_name = "ocl"
-        print "opencl t=%.1f ms, intensity=%.0f"%(base_time, sum(base))
-        #print "base", base
-        #print max(base), min(base)
+        print("opencl t=%.1f ms, intensity=%.0f"%(base_time, sum(base)))
+        #print("base " + base)
+        #print(max(base), min(base))
 
     # Comparison calculation
@@ -306,12 +306,12 @@
                                     dtype=dtype, cutoff=cutoff, Nevals=Ncomp)
         comp_name = "ctypes"
-        print "ctypes t=%.1f ms, intensity=%.0f"%(comp_time, sum(comp))
+        print("ctypes t=%.1f ms, intensity=%.0f"%(comp_time, sum(comp)))
     elif Ncomp > 0:
         try:
             comp, comp_time = eval_sasview(model_definition, pars, data, Ncomp)
             comp_name = "sasview"
-            #print "base/sasview", (base-pars['background'])/(comp-pars['background'])
-            print "sasview t=%.1f ms, intensity=%.0f"%(comp_time, sum(comp))
-            #print "sasview",comp
+            #print("base/sasview", (base-pars['background'])/(comp-pars['background']))
+            print("sasview t=%.1f ms, intensity=%.0f"%(comp_time, sum(comp)))
+            #print("sasview",comp)
         except ImportError:
             traceback.print_exc()
@@ -320,11 +320,11 @@
     # Compare, but only if computing both forms
     if Nbase > 0 and Ncomp > 0:
-        #print "speedup %.2g"%(comp_time/base_time)
-        #print "max |base/comp|", max(abs(base/comp)), "%.15g"%max(abs(base)), "%.15g"%max(abs(comp))
+        #print("speedup %.2g"%(comp_time/base_time))
+        #print("max |base/comp|", max(abs(base/comp)), "%.15g"%max(abs(base)), "%.15g"%max(abs(comp)))
         #comp *= max(base/comp)
         resid = (base - comp)
         relerr = resid/comp
         #bad = (relerr>1e-4)
-        #print relerr[bad],comp[bad],base[bad],data.qx_data[bad],data.qy_data[bad]
+        #print(relerr[bad],comp[bad],base[bad],data.qx_data[bad],data.qy_data[bad])
         _print_stats("|%s-%s|"%(base_name,comp_name)+(" "*(3+len(comp_name))), resid)
         _print_stats("|(%s-%s)/%s|"%(base_name,comp_name,comp_name), relerr)
@@ -379,5 +379,5 @@
         "zero-offset:%+.3e"%np.mean(err),
         ]
-    print label,"  ".join(data)
+    print(label+"  ".join(data))
 
 
@@ -466,5 +466,5 @@
         sys.exit(1)
     if args[0] not in MODELS:
-        print "Model %r not available. Use one of:\n    %s"%(args[0],models)
+        print("Model %r not available. Use one of:\n    %s"%(args[0],models))
         sys.exit(1)
     if len(args) > 3:
@@ -475,5 +475,5 @@
                   and not any(o.startswith('-%s='%t) for t in VALUE_OPTIONS)]
     if invalid:
-        print "Invalid options: %s"%(", ".join(invalid))
+        print("Invalid options: %s"%(", ".join(invalid)))
         sys.exit(1)
 
@@ -500,5 +500,5 @@
             # extract base name without distribution
             s = set(p.split('_pd')[0] for p in pars)
-            print "%r invalid; parameters are: %s"%(k,", ".join(sorted(s)))
+            print("%r invalid; parameters are: %s"%(k,", ".join(sorted(s))))
             sys.exit(1)
         set_pars[k] = float(v) if not v.endswith('type') else v
Index: sasmodels/compare_many.py
===================================================================
--- sasmodels/compare_many.py	(revision 4b41184119ee1ac9a326eed9d9a450388eb4a8e1)
+++ sasmodels/compare_many.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -53,6 +53,6 @@
             raise
         except:
-            print >>sys.stderr, traceback.format_exc()
-            print >>sys.stderr, "when comparing",name,"for seed",seed
+            traceback.print_exc()
+            print("when comparing %s for %d"%(name, seed))
             if hasattr(data, 'qx_data'):
                 result = np.NaN*data.data
@@ -71,5 +71,5 @@
     max_diff = [0]
     for k in range(N):
-        print >>sys.stderr, name, k
+        print("%s %d"%(name, k))
         pars_i, seed = randomize_model(pars)
         constrain_pars(model_definition, pars_i)
@@ -109,9 +109,9 @@
         else:
             print(("%d,"%seed)+','.join("%g"%v for v in columns))
-    print '"good","%d/%d","max diff",%g'%(num_good, N, max_diff[0])
+    print('"good","%d/%d","max diff",%g'%(num_good, N, max_diff[0]))
 
 
 def print_usage():
-    print "usage: compare_many.py MODEL COUNT (1dNQ|2dNQ) (CUTOFF|mono) (single|double|quad)"
+    print("usage: compare_many.py MODEL COUNT (1dNQ|2dNQ) (CUTOFF|mono) (single|double|quad)")
 
 
@@ -155,5 +155,5 @@
     model = sys.argv[1]
     if not (model in MODELS) and (model != "all"):
-        print 'Bad model %s.  Use "all" or one of:'
+        print('Bad model %s.  Use "all" or one of:')
         print_models()
         sys.exit(1)
Index: sasmodels/core.py
===================================================================
--- sasmodels/core.py	(revision 7cf2cfd8695ecfd2684525ab15c14bc00f23616a)
+++ sasmodels/core.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -179,5 +179,5 @@
         value, weight = dispersion_mesh(vol_pars)
         individual_radii = ER(*value)
-        #print values[0].shape, weights.shape, fv.shape
+        #print(values[0].shape, weights.shape, fv.shape)
         return np.sum(weight*individual_radii) / np.sum(weight)
 
Index: sasmodels/data.py
===================================================================
--- sasmodels/data.py	(revision ac21c7fc8dbd30f06ff8bf8d1112ca5515fd8c48)
+++ sasmodels/data.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -274,5 +274,5 @@
             plt.subplot(121)
 
-        #print vmin, vmax
+        #print(vmin, vmax)
         positive = False
         if plot_data:
Index: sasmodels/direct_model.py
===================================================================
--- sasmodels/direct_model.py	(revision 7cf2cfd8695ecfd2684525ab15c14bc00f23616a)
+++ sasmodels/direct_model.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -140,5 +140,5 @@
 
     if len(sys.argv) < 3:
-        print "usage: python -m sasmodels.direct_model modelname (q|qx,qy) par=val ..."
+        print("usage: python -m sasmodels.direct_model modelname (q|qx,qy) par=val ...")
         sys.exit(1)
     model_name = sys.argv[1]
@@ -156,5 +156,5 @@
             data = empty_data2D([qx],[qy])
         else:
-            print "use q or qx,qy or ER or VR"
+            print("use q or qx,qy or ER or VR")
             sys.exit(1)
     else:
@@ -168,10 +168,10 @@
                 for k,v in [pair.split('=')])
     if call == "ER":
-        print calculator.ER(**pars)
+        print(calculator.ER(**pars))
     elif call == "VR":
-        print calculator.VR(**pars)
+        print(calculator.VR(**pars))
     else:
         Iq = calculator(**pars)
-        print Iq[0]
+        print(Iq[0])
 
 if __name__ == "__main__":
Index: sasmodels/exception.py
===================================================================
--- sasmodels/exception.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
+++ sasmodels/exception.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -20,6 +20,6 @@
         >>> D = {}
         >>> try:
-        ...    print D['hello']
-        ... except Exception,exc:
+        ...    print(D['hello'])
+        ... except Exception as exc:
         ...    annotate_exception(exc, "while accessing 'D'")
         ...    raise
Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision e88bb782b848d9a16915ecf445935086c1ddaca0)
+++ sasmodels/generate.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -546,5 +546,5 @@
         defines.append(('IQXY_HAS_THETA', '1'))
 
-    #for d in defines: print d
+    #for d in defines: print(d)
     DEFINES = '\n'.join('#define %s %s' % (k, v) for k, v in defines)
     SOURCES = '\n\n'.join(source)
@@ -558,5 +558,5 @@
     Interpret the model definition file, categorizing the parameters.
     """
-    #print kernelfile
+    #print(kernelfile)
     category = getattr(kernel_module, 'category', None)
     parameters = COMMON_PARAMETERS + kernel_module.parameters
@@ -655,9 +655,9 @@
     make(cylinder)
     toc = (datetime.datetime.now() - tic).total_seconds()
-    print "time:", toc
+    print("time: %g"%toc)
 
 def main():
     if len(sys.argv) <= 1:
-        print "usage: python -m sasmodels.generate modelname"
+        print("usage: python -m sasmodels.generate modelname")
     else:
         name = sys.argv[1]
@@ -666,5 +666,5 @@
         model = getattr(sasmodels.models, name)
         source, _ = make(model)
-        print source
+        print(source)
 
 if __name__ == "__main__":
Index: sasmodels/kernelcl.py
===================================================================
--- sasmodels/kernelcl.py	(revision 92da2316c75e24044469af05f4f89967a0422190)
+++ sasmodels/kernelcl.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -57,5 +57,5 @@
     # Ask OpenCL for the default context so that we know that one exists
     cl.create_some_context(interactive=False)
-except Exception, exc:
+except Exception as exc:
     warnings.warn(str(exc))
     raise RuntimeError("OpenCL not available")
@@ -184,5 +184,5 @@
         try:
             self.context = cl.create_some_context(interactive=False)
-        except Exception, exc:
+        except Exception as exc:
             warnings.warn(str(exc))
             warnings.warn("pyopencl.create_some_context() failed")
@@ -191,5 +191,5 @@
     def compile_program(self, name, source, dtype):
         if name not in self.compiled:
-            #print "compiling",name
+            #print("compiling",name)
             self.compiled[name] = compile_model(self.context, source, dtype)
         return self.compiled[name]
@@ -359,8 +359,8 @@
                 if pd_pars else np.empty(0, dtype=self.q_input.dtype)
             loops = np.ascontiguousarray(loops.T, self.q_input.dtype).flatten()
-            #print "loops",Nloops, loops
-
-            #import sys; print >>sys.stderr,"opencl eval",pars
-            #print "opencl eval",pars
+            #print("loops",Nloops, loops)
+
+            #import sys; print("opencl eval",pars)
+            #print("opencl eval",pars)
             if len(loops) > 2 * MAX_LOOPS:
                 raise ValueError("too many polydispersity points")
Index: sasmodels/kerneldll.py
===================================================================
--- sasmodels/kerneldll.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
+++ sasmodels/kerneldll.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -146,5 +146,5 @@
         os.fdopen(fid,"w").write(source)
         command = COMPILE%{"source":filename, "output":dll}
-        print "Compile command:",command
+        print("Compile command: "+command)
         status = os.system(command)
         if status != 0 or not os.path.exists(dll):
@@ -152,5 +152,5 @@
         else:
             ## uncomment the following to keep the generated c file
-            os.unlink(filename); print "saving compiled file in %r"%filename
+            os.unlink(filename); print("saving compiled file in %r"%filename)
     return dll
 
@@ -197,8 +197,8 @@
         Npd2d = len(self.info['partype']['pd-2d'])
 
-        #print "dll",self.dllpath
+        #print("dll",self.dllpath)
         try:
             self.dll = ct.CDLL(self.dllpath)
-        except Exception, exc:
+        except Exception as exc:
             annotate_exception(exc, "while loading "+self.dllpath)
             raise
@@ -291,5 +291,5 @@
         fixed = [real(p) for p in fixed_pars]
         args = self.q_input.q_pointers + [self.p_res, nq] + dispersed + fixed
-        #print pars
+        #print(pars)
         self.kernel(*args)
 
Index: sasmodels/kernelpy.py
===================================================================
--- sasmodels/kernelpy.py	(revision 062c56df8360e174e5c222181238d564ad661ef2)
+++ sasmodels/kernelpy.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -108,6 +108,6 @@
 
     def __call__(self, fixed, pd, cutoff=1e-5):
-        #print "fixed",fixed
-        #print "pd", pd
+        #print("fixed",fixed)
+        #print("pd", pd)
         args = self.args[:]  # grab a copy of the args
         form, form_volume = self.kernel, self.info['form_volume']
Index: sasmodels/model_test.py
===================================================================
--- sasmodels/model_test.py	(revision 2781b2ec06d3622da88b34a727fcd2d86dca593a)
+++ sasmodels/model_test.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -68,7 +68,7 @@
         model_definition = load_model_definition(model_name)
 
-        #print '------'
-        #print 'found tests in', model_name
-        #print '------'
+        #print('------')
+        #print('found tests in', model_name)
+        #print('------')
 
         # if ispy then use the dll loader to call pykernel
@@ -93,5 +93,5 @@
                                      test_method_name,
                                      platform="ocl", dtype='single')
-                #print "defining", test_name
+                #print("defining", test_name)
                 suite.addTest(test)
 
@@ -144,5 +144,5 @@
                     pass
 
-            except Exception,exc:
+            except Exception as exc:
                 annotate_exception(exc, self.test_name)
                 raise
@@ -201,5 +201,5 @@
     if models and models[0] == 'opencl':
         if not HAVE_OPENCL:
-            print >>sys.stderr, "opencl is not available"
+            print("opencl is not available")
             return 1
         loaders = ['opencl']
@@ -215,5 +215,5 @@
         loaders = ['opencl', 'dll']
     if not models:
-        print >>sys.stderr, """\
+        print("""\
 usage:
   python -m sasmodels.model_test [opencl|dll|opencl_and_dll] model1 model2 ...
@@ -221,5 +221,5 @@
 If model1 is 'all', then all except the remaining models will be tested.
 If no compute target is specified, then models will be tested with both opencl
-and dll; the compute target is ignored for pure python models."""
+and dll; the compute target is ignored for pure python models.""")
 
         return 1
Index: sasmodels/resolution.py
===================================================================
--- sasmodels/resolution.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
+++ sasmodels/resolution.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -134,7 +134,7 @@
     Apply the resolution weight matrix to the computed theory function.
     """
-    #print "apply shapes", theory.shape, weight_matrix.shape
+    #print("apply shapes", theory.shape, weight_matrix.shape)
     Iq = np.dot(theory[None,:], weight_matrix)
-    #print "result shape",Iq.shape
+    #print("result shape",Iq.shape)
     return Iq.flatten()
 
@@ -287,5 +287,5 @@
     weights = np.zeros((len(q), len(q_calc)), 'd')
 
-    #print q_calc
+    #print(q_calc)
     for i, (qi, w, h) in enumerate(zip(q, width, height)):
         if w == 0. and h == 0.:
@@ -301,6 +301,6 @@
             in_x = 1.0 * ((q_calc >= qi-h) & (q_calc <= qi+h))
             abs_x = 1.0*(q_calc < abs(qi - h)) if qi < h else 0.
-            #print qi - h, qi + h
-            #print in_x + abs_x
+            #print(qi - h, qi + h)
+            #print(in_x + abs_x)
             weights[i,:] = (in_x + abs_x) * np.diff(q_edges) / (2*h)
         else:
@@ -320,7 +320,7 @@
     u_edges[q_edges > u_limit] = u_limit**2 - qi**2
     weights = np.diff(np.sqrt(u_edges))/w
-    #print "i, qi",i,qi,qi+width
-    #print q_calc
-    #print weights
+    #print("i, qi",i,qi,qi+width)
+    #print(q_calc)
+    #print(weights)
     return weights
 
@@ -521,5 +521,5 @@
             u = sqrt((qi+h_grid)**2 + w_grid**2)
             Iu = np.interp(u, q_calc, Iq)
-            #print np.trapz(Iu, w_grid, axis=1)
+            #print(np.trapz(Iu, w_grid, axis=1))
             Is = np.trapz(np.trapz(Iu, w_grid, axis=1), h_grid[:,0])
             result[i] = Is / (2*h*w)
@@ -675,5 +675,5 @@
         #idx = abs(err) >= tolerance
         #problem = zip(q[idx], output[idx], answer[idx], err[idx])
-        #print "\n".join(str(v) for v in problem)
+        #print("\n".join(str(v) for v in problem))
         np.testing.assert_allclose(output, answer, rtol=tolerance)
 
@@ -786,5 +786,5 @@
         output = resolution.apply(eval_form(resolution.q_calc, form, pars))
         # TODO: 10% is too much error; use better algorithm
-        #print np.max(abs(answer-output)/answer)
+        #print(np.max(abs(answer-output)/answer))
         self.compare(q, output, answer, 0.1)
 
Index: sasmodels/resolution2d.py
===================================================================
--- sasmodels/resolution2d.py	(revision cd8dde1fd7ff4fa77d7adabeeb70337fa986a89e)
+++ sasmodels/resolution2d.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -179,6 +179,6 @@
 
     from sas.dataloader import Data2D
-    #for i in range(10): print i, 0.001 + i*0.008/9.0
-    #for i in range(100): print i, int(math.floor( (i/ (100/9.0)) ))
+    #for i in range(10): print(i, 0.001 + i*0.008/9.0)
+    #for i in range(100): print(i, int(math.floor( (i/ (100/9.0)) )))
     out = Data2D()
     out.data = z
@@ -198,12 +198,12 @@
     value = smear.get_value()
     ## All data are ones, so the smeared should also be ones.
-    print "Data length =", len(value)
-    print " 2D linear function, I = 0 + 1*qy"
+    print("Data length =", len(value))
+    print(" 2D linear function, I = 0 + 1*qy")
     text = " Gaussian weighted averaging on a 2D linear function will "
     text += "provides the results same as without the averaging."
-    print text
-    print "qx_data", "qy_data", "I_nonsmear", "I_smeared"
+    print(text)
+    print("qx_data", "qy_data", "I_nonsmear", "I_smeared")
     for ind in range(len(value)):
-        print x[ind], y[ind], model.evalDistribution([x, y])[ind], value[ind]
+        print(x[ind], y[ind], model.evalDistribution([x, y])[ind], value[ind])
 
 
@@ -218,6 +218,6 @@
 
     from DataLoader import Data2D
-    #for i in range(10): print i, 0.001 + i*0.008/9.0
-    #for i in range(100): print i, int(math.floor( (i/ (100/9.0)) ))
+    #for i in range(10): print(i, 0.001 + i*0.008/9.0)
+    #for i in range(100): print(i, int(math.floor( (i/ (100/9.0)) )))
     out = Data2D()
     out.data = z
@@ -233,4 +233,4 @@
     value = Smearer2D(out,model,index).get_value()
     ## All data are ones, so the smeared values should also be ones.
-    print "Data length =",len(value), ", Data=",value
-"""
+    print("Data length =",len(value), ", Data=",value)
+"""
Index: sasmodels/sasview_model.py
===================================================================
--- sasmodels/sasview_model.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
+++ sasmodels/sasview_model.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
@@ -187,5 +187,5 @@
                for d in self._model.info['partype']['pd-2d']
                for p in ('npts', 'nsigmas', 'width')]
-        #print ret
+        #print(ret)
         return ret
 
@@ -303,5 +303,5 @@
             values, weights = self._dispersion_mesh()
             fv = ER(*values)
-            #print values[0].shape, weights.shape, fv.shape
+            #print(values[0].shape, weights.shape, fv.shape)
             return np.sum(weights * fv) / np.sum(weights)
 
