473,320 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

py2exe, Inno Setup, and tkinter

I'm trying to use py2exe and Inno Setup to build an installer for
shtoom, which uses tkinter.

If I take the py2exe generated directory, and run the executable from
there, it works fine.

If I add all the files in the directory to an installer (including
the tk-8.4 and tcl-8.4 directories), it builds an installer fine.

But when I run the installer, and install to, say c:/Program Files/Shtoom,
running the program fails with
Traceback (most recent call last):
File "<string>", line 78, in ?
File "<string>", line 75, in main
File "<string>", line 66, in findUserInterface
File "<string>", line 33, in tryTkInterface
File "shtoom\ui\tkshtoom.pyc", line 23, in main
File "shtoom\ui\tkui\main.pyc", line 11, in __init__
File "Tkinter.pyc", line 1564, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{c:/Program Files/lib/tcl8.4} {c:/Program Files/lib/tcl8.4} c:/lib/tcl8.4 {c:/Program Files/library} c:/library c:/../tcl8.4.3/library

This probably means that Tcl wasn't installed properly.

The init.tcl is actually in C:/Program Files/Shtoom/tcl8.4. Why is
it not looking in the correct location? How can I fix this?

Thanks,
Anthony

Jul 18 '05 #1
2 6925
Anthony Baxter wrote:
I'm trying to use py2exe and Inno Setup to build an installer for
shtoom, which uses tkinter.

If I take the py2exe generated directory, and run the executable from
there, it works fine.

If I add all the files in the directory to an installer (including
the tk-8.4 and tcl-8.4 directories), it builds an installer fine.


I have a script for creating innosetup's [FILE] section. I have used
this just fine so it fails for you it may indicate a problem with tcl/tk
on your *normal* installation. Can you run your program outside of py2exe?

Here is the script:

import os
# This script creates the [FILES] section for innosetup
# I use it for creating the installer for py2exe
# generated distributions. Mainly because adding the
# tcl/tk stuff is a royal pain.

# Point FROM_DIRECTORY to py2exe's destination directory
# This will include all tcl/tk and wxPython files and
# everything else in the directory and subdirectories.

FROM_DIRECTORY = r"C:\Users\kelley\Working\PlateReader\app\dist\Vis ta"

os.chdir(FROM_DIRECTORY)
def innoSourceLine(source, dest):
return 'Source: "%s"; DestDir: "{app}\%s"; CopyMode:
alwaysoverwrite'%(source, dest)

for root, dirs, files in os.walk("."):
sourcedir = os.path.abspath(root)
for f in files:
# get the destination directory
source = os.path.join(sourcedir, f)
dest = root
print innoSourceLine(source, dest)
# Brian

Jul 18 '05 #2
Anthony Baxter <an*****@interlink.com.au> writes:
I'm trying to use py2exe and Inno Setup to build an installer for
shtoom, which uses tkinter.

If I take the py2exe generated directory, and run the executable from
there, it works fine.

If I add all the files in the directory to an installer (including
the tk-8.4 and tcl-8.4 directories), it builds an installer fine.

But when I run the installer, and install to, say c:/Program Files/Shtoom,
running the program fails with
Traceback (most recent call last):
File "<string>", line 78, in ?
File "<string>", line 75, in main
File "<string>", line 66, in findUserInterface
File "<string>", line 33, in tryTkInterface
File "shtoom\ui\tkshtoom.pyc", line 23, in main
File "shtoom\ui\tkui\main.pyc", line 11, in __init__
File "Tkinter.pyc", line 1564, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{c:/Program Files/lib/tcl8.4} {c:/Program Files/lib/tcl8.4} c:/lib/tcl8.4 {c:/Program Files/library} c:/library c:/../tcl8.4.3/library

This probably means that Tcl wasn't installed properly.

The init.tcl is actually in C:/Program Files/Shtoom/tcl8.4. Why is
it not looking in the correct location? How can I fix this?


Are you sure your installer reproduces the same directory structure as
the dist directory has?

I would expect the init.tcl in this directory:

c:/Program Files/shtoom/tcl/tcl8.4/init.tcl

Thomas
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
I've just started playing with py2exe and tried to create a distribution for a slightly complex Tkinter program that refers to a class in another file. I just try to create an .exe for the main...
3
by: dcrespo | last post by:
Any comments?
1
by: Martin | last post by:
Hi I would like to place a message in an uninstaller window which will inform the user that some folders haven't been deleted. Is that possible using Inno Setup? -- Thanks in advance Martin
4
by: Jon | last post by:
Hi, I have created a DLL in VB.NET. I try to use it in my Installer program which is written in pascal (inno setup), however unsuccessfully.. Does that means any DLL created in .NET can...
0
by: syamlalz | last post by:
HI..Does anyone know about controlling the "Browse button" in Inno setup?? When cliking it,it should show only the drive names...not the folders... Please help me.
1
by: flamkuavos | last post by:
function NextButtonClick (...) begin if CurPageID = TestPage.ID then begin if(choose the "uninstall" Radio) ?...? ????????????? {{uninstallexe} doesnot work here} ... end else begin...
0
by: Deemar | last post by:
I read somewhere that the Delphi/Pascal used in this application is similar to Python, sorry if I got it in the wrong forum here. I have a setup program made with Inno Setup and there's a premade...
6
by: Apostle | last post by:
I don't know where to post it inBytes, but since I'm used to Python forum, I hope someone will help me here. Advices of as to where I should post this are valid! I have made a project, compiled it...
0
by: vishnu1986 | last post by:
Hi guys, I saw quite a few posts regarding this but I was unable to solve this problem that I am facing. First off, when I do the following in my setup.py, windows= } ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.