Python Forum
[Tkinter] Problem with new PC
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Problem with new PC
#1
For many years I have been using a little piece of software written in Python that creates a GUI in a video game
and allows the user to create objects/characters while the game is running, for custom modding purposes.
It uses Tkinter included in the Python included with the game. The game (Blade of Darkness)dates from 1999
so quite ancient. I've used this script over various PCs starting with win98se. Big Grin
My problem is this: I recently got a new PC with win 10, which runs like lightning and the game also runs fine,
but if I try to start the add-on script it throws up a error....

Traceback (innermost last):
  File "DefFuncs.py", line 1787, in InitEB
    import EBrowser
  File "..\..\Scripts\EBrowser.py", line 2365, in ?
    root = Tkinter.Tk()
  File "..\..\Lib\PythonLib\lib-tk\Tkinter.py", line 886, in __init__
    self.tk = _tkinter.create(screenName, baseName, className)
TclError: Can't find a usable init.tcl in the following directories: 
    {} ./lib/tcl8.0 ./lib/tcl8.0 ./library ./library ./tcl8.0/library ./tcl8.0/library



This probably means that Tcl wasn't installed properly.


It is exactly the same script and installation on my old (win 7) pc, where it works. So I can only conclude the
the win 10 os does not like it somehow.

Any possible fixes greatly appreciated. I should point out that while I am reasonably conversant with python
my knowledge is largely confined to programming this game. Cry
Reply
#2
Quote:root = Tkinter.Tk()
It seems you're trying to run a 2.7 script in 3.x
you can modify the import to tkinter and the :
root= tkinter.Tk()
there may be other parts also... not enough info or download and run python 2.7
Reply
#3
Thanks for the reply. If I modify the import all that happens is I get a name error.

I have been out of contact with the guy who wrote the script for many years so I can't get
a fix from him.
Reply
#4
post the error or script not enough info...
Reply
#5
Just to say, I cured it by copying the entire TCL folder from the PythonLib of the game and pasted it
directly on the main drive. Set -

setx /M TCL_LIBRARY "C:\Tcl\lib\tcl8.0"

via the Admin command prompt and it works as normal.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020