By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,814 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,814 IT Pros & Developers. It's quick & easy.

installing BLT module : python beginner

P: 18
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_FindCommand’
/usr/OpenFOAM/ext/Linux/include/tclDecls.h:3125: error: previous declaration of ‘Tcl_FindCommand’ was here
bltNsUtil.h:67: error: conflicting types for ‘Tcl_CreateNamespace’
/usr/OpenFOAM/ext/Linux/include/tclDecls.h:3070: error: previous declaration of ‘Tcl_CreateNamespace’ was here
bltNsUtil.h:72: error: conflicting types for ‘Tcl_FindNamespace’
/usr/OpenFOAM/ext/Linux/include/tclDecls.h:3118: error: previous declaration of ‘Tcl_FindNamespace’ 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!
Mar 31 '08 #1
Share this Question
Share on Google+
6 Replies


P: 43
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.
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/python
  2.  
  3. import Tkinter
  4. import Pmw
  5. top= Tkinter.Tk()
  6. if not Pmw.Blt.haveblt(top):
  7.      print "BLT is not installed!"
  8. else:
  9.      print "Good BLT install"  
Apr 2 '08 #2

P: 18
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.
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/python
  2.  
  3. import Tkinter
  4. import Pmw
  5. top= Tkinter.Tk()
  6. if not Pmw.Blt.haveblt(top):
  7.      print "BLT is not installed!"
  8. else:
  9.      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.
Apr 4 '08 #3

P: 43
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.
Apr 4 '08 #4

P: 18
thanks. i'll do my best. :)
Apr 4 '08 #5

P: 2
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\blt2.4 into the Tcl8.4 folder at C:\Python24\tcl\tcl8.4
Mar 27 '09 #6

P: 2
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.
Mar 30 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.