installing BLT module : python beginner

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • everlast
    New Member
    • Nov 2007
    • 18

    installing BLT module : python beginner

    I'm installing BLT module (among others) in my directories - not as a root user. The installation of Tcl and Tk went fine(that means that all of my system variables like PREFIX are set correctly), but when I try to install BLT i get this error message with make:


    (cd src; make all)
    make[1]: Entering directory `/usr/OpenFOAM/ext/src/tcl/blt2.4z/src'
    gcc -c -Wall -m64 -fPIC -I. -I. -I/usr/OpenFOAM/ext/Linux/include bltAlloc.c
    In file included from bltInt.h:80,
    from bltAlloc.c:1:
    bltNsUtil.h:50: error: conflicting types for ‘Tcl_FindComman d’
    /usr/OpenFOAM/ext/Linux/include/tclDecls.h:3125 : error: previous declaration of ‘Tcl_FindComman d’ was here
    bltNsUtil.h:67: error: conflicting types for ‘Tcl_CreateName space’
    /usr/OpenFOAM/ext/Linux/include/tclDecls.h:3070 : error: previous declaration of ‘Tcl_CreateName space’ was here
    bltNsUtil.h:72: error: conflicting types for ‘Tcl_FindNamesp ace’
    /usr/OpenFOAM/ext/Linux/include/tclDecls.h:3118 : error: previous declaration of ‘Tcl_FindNamesp ace’ was here
    bltNsUtil.h:75: error: conflicting types for ‘Tcl_Export’
    /usr/OpenFOAM/ext/Linux/include/tclDecls.h:3088 : error: previous declaration of ‘Tcl_Export’ was here
    make[1]: *** [bltAlloc.o] Error 1
    make[1]: Leaving directory `/usr/OpenFOAM/ext/src/tcl/blt2.4z/src'
    make: *** [all] Error 2

    Please help, I'm eager to start learning Python (i bought 2 books from Amazon :), but I need to get it working. Thank You!
  • woooee
    New Member
    • Mar 2008
    • 43

    #2
    What distro are you using? Pretty much all of the package managers have BLT so you don't have to install it yourself. Note that PMW is a dependency for BLT in Python. There aren't any true Python bindings for BLT, there is Pmw.Blt, which is a subset but probably has everything you want to use. Also, run the following code. BLT may already be installed depending on your distro.
    Code:
    #!/usr/bin/python
    
    import Tkinter
    import Pmw
    top= Tkinter.Tk()
    if not Pmw.Blt.haveblt(top):
         print "BLT is not installed!"
    else:
         print "Good BLT install"

    Comment

    • everlast
      New Member
      • Nov 2007
      • 18

      #3
      Originally posted by woooee
      What distro are you using? Pretty much all of the package managers have BLT so you don't have to install it yourself. Note that PMW is a dependency for BLT in Python. There aren't any true Python bindings for BLT, there is Pmw.Blt, which is a subset but probably has everything you want to use. Also, run the following code. BLT may already be installed depending on your distro.
      Code:
      #!/usr/bin/python
      
      import Tkinter
      import Pmw
      top= Tkinter.Tk()
      if not Pmw.Blt.haveblt(top):
           print "BLT is not installed!"
      else:
           print "Good BLT install"
      i'm working on 64-bit open SUSE 10.3

      i've tried to install Tcl and Tk in myown set of directories. i've launched python and executed Your code, but there were error messages that Tcl and Pmw were not installed.

      is there a way for me to start over? how can I remove python and everything else related from my /usr/bin and other default installation directories? then I can install everything in my local set of directories and test each program as I go.

      Comment

      • woooee
        New Member
        • Mar 2008
        • 43

        #4
        I haven't compiled Python in years. If I remember correctly, you use --prefix to compile to a different directory. For the tcl/tk,bindings, it's something like --with-tcl directory_name for the Python config file, I think. You'll have to try and find the compile options on the python.org website. Activestate's version has an installer, but I've never used it so don't know if you can specify any options.

        Another option would be to just use the existing Python installation and add the TCL/Tk path to PYTHONPATH with a sys.path.append () in the program. Also, a symlink to /usr/lib/ for tcl and tk should work.

        Comment

        • everlast
          New Member
          • Nov 2007
          • 18

          #5
          thanks. i'll do my best. :)

          Comment

          • Zetribe
            New Member
            • Mar 2009
            • 2

            #6
            I use BLT running under Python 2.4.4. To get BLT to run I installed BLT to c:\program files \tcl using blt24z-for-tcl84.exe. I then copied the file pkgIndex.tcl from C:\Program Files\Tcl\lib\b lt2.4 into the Tcl8.4 folder at C:\Python24\tcl \tcl8.4

            Comment

            • Zetribe
              New Member
              • Mar 2009
              • 2

              #7
              BLT 2.4 has some minor changes in regards to Image handling. for instance you can no longer carry our screen snapshots with the old

              img = PhotoImage(name ="image", master=master)
              g.snap(img) # take snapshot
              img.write("file .gif") # and save it to file.

              Images now default to ppm's. You need to force GIF output with the following

              img = PhotoImage(name ="image", master=master)
              g.snap(img) # take snapshot
              img.write("file .gif" ,format = 'GIF') # and save it to file.

              Comment

              Working...