Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

A message from Jean Ballet:

No Format
From Tue Jun 17 01:09:12 2008
Subject: python code in binary release Science Tools
Date: Tue, 17 Jun 2008 10:07:16 +0200
To: <>
Cc: <>, <>

Dear Jim,


After Ludovic reported that he had trouble using the new pointfit python
module I remembered that I had failed to use ModelEditor at some point.

So I tried again, using the binary release of ST v9r5p4.



Traceback (most recent call last):

  File "<string>", line 1, in ?

"/dsm/saplxglast/glast/sas/binary/ScienceTools-v9r5p4/pythonModules/Mode", line 15, in ?

    import Tkinter as Tk

ImportError: No module named Tkinter


I tried to understand why this occurred. I looked into
${INST_DIR}/bin/config/ and noticed that


although there was no such directory as
${INST_DIR}/python/lib/python2.4. python2.5 was present there instead.

I tried changing python2.4 to python2.5


ModelEditor                                           'import site'
failed; use -v for traceback

Traceback (most recent call last):

  File "<string>", line 1, in ?

"/dsm/saplxglast/glast/sas/binary/ScienceTools-v9r5p4/pythonModules/Mode", line 11, in ?

    import os

.5/", line 134

    from os.path import (curdir, pardir, sep, pathsep, defpath, extsep,


SyntaxError: invalid syntax


It looks like under python2.5 is not compatible with the python
version that is called by ModelEditor.

If I try calling directly I get



Traceback (most recent call last):

"/dsm/saplxglast/glast/sas/binary/ScienceTools-v9r5p4/pythonModules/Mode", line 538, in <module>


"/dsm/saplxglast/glast/sas/binary/ScienceTools-v9r5p4/pythonModules/Mode", line 531, in ModelEditor

    root = RootWindow(_spectralFuncs, _spatialFuncs)

"/dsm/saplxglast/glast/sas/binary/ScienceTools-v9r5p4/pythonModules/Mode", line 31, in __init__


.5/lib-tk/", line 1636, in __init__ = _tkinter.create(screenName, baseName, className,
interactive, wantobjects, useTk, sync, use)

_tkinter.TclError: Can't find a usable init.tcl in the following



This probably means that Tcl wasn't installed properly.


Here it went further. I looked around but could find no trace of a TCL
library under the binary ST distribution.

The references to lheasoft (FTOOLS) look hardcoded from the place where
the Science Tools were compiled.

My impression is that the python implementation in the binary release of
the Science Tools is quite shaky.

It works for pyLikelihood, but not for much else.


The outcome of the 2nd trial (after changing python2.4 to 2.5) suggests
that ModelEditor does NOT call the python version in the Science Tools
(under $INST_DIR/python/bin) but the native python on my system (which
happens to be 2.3.4).

This is very possible if it does not use gtpython, because
$INST_DIR/python/bin is not in PATH (it has no reason to be).

If I add $INST_DIR/python/bin to my PATH, then ModelEditor returns the
same error message as the call to via gtpython.


All the best,