I tried to install TkTreectrl on Windows7 without success. I downloaded the package of version 2.0.1 unzipped and tried to run the setup.py. That one complained in the first place alway that the folder TkTreectrl doesn't exist, which was wrong since the folder comes with the download and I was running setup.py within the same directory where TkTreectrl was located.
According to the readme file there is another option to install and that would be to copy the TkTreectrl folder into the site-packages directory. So, I did this, and nothing changed. Then I did run setup.py again and it didnt complain about a missing TkTreectrl folder.
However,
from Tkinter import *
import TkTreectrl as Tktree
root = Tk()
t=Tktree.Treectrl(root, width=20, height=20).pack()
root.mainloop()
comes back with the error message:
ver = master.tk.call('package', 'require', 'treectrl') _tkinter.TclError: can't find package treectrl
Could somebody tell me where my error is?
Cheers
Well tk is a whole different language itself. There should be a file for that widget which manages everything for that widget. All python does is interpret that and just allow us to use that in tkinter. So odds are you don't have the file or if you do it is in the wrong place.
In order to use TKTreectrl you need to also have the Tcl/Tk treectrl package installed.
From http://tkintertreectrl.sourceforge.net/ under Installation:
Of course you will also have to install the Tcl/Tk treectrl package to be able to use the TkTreectrl module.
On windows systems simply download the tktreectrl-2.x.x-Tk8.x-win32.zip archive suitable for the Tk version in use and copy the contents of the archive into your Python installation's tcl folder.
On unix systems you will probably have to compile the treectrl package from the sources. To do so, download and unpack the latest tktreectrl-2.x.x.tar.gz archive, cd into the tktreectrl-2.x.x directory and type (as root)
./configure && make && make install
If this fails it is most likely because configure cannot find the Tcl installation. In this case (or if you have multiple versions of Tcl/Tk installed) you have to pass the paths to the tclConfig.sh and tkConfig.sh to configure , as for example:
./configure --with-tcl=/usr/lib/tcl8.4 --with-tk=/usr/lib/tk8.4 make make install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With