简体   繁体   English

Inno Setup Compiler后init.tcl出现Python错误

[英]Python error with init.tcl after Inno Setup Compiler

I have a program which I converted with py2exe to an exe. 我有一个用py2exe转换为exe的程序。 After that I tried to make an installer with Inno Setup. 之后,我尝试使用Inno Setup创建安装程序。 I included all necessary files like .dll, .pyd, .gif, .wav, the tlc folder (tcl8.5, tk8.5) etc. But after installing the program it gives me this error: 我包括了所有必需的文件,例如.dll,.pyd,.gif,.wav,tlc文件夹(tcl8.5,tk8.5)等。但是在安装程序后,它给了我这个错误:

C:\Program Files (x86)\test>test.exe
Traceback (most recent call last):
  File "test.py", line 9359, in <module>
  File "test.py", line 11, in __init__
  File "Tkinter.pyc", line 1745, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
    {C:/Program Files (x86)/lib/tcl8.5} {C:/Program Files (x86)/lib/tcl8.5} C:/l
ib/tcl8.5 {C:/Program Files (x86)/library} C:/library C:/tcl8.5.2/library C:/tcl
8.5.2/library



This probably means that Tcl wasn't installed properly.

How can I fix this? 我怎样才能解决这个问题? Thanks in advance. 提前致谢。

This solved the problem I had. 这解决了我遇到的问题。 I've created my Inno Setup (v5.5.5) outside the py2exe output dir named dest (v0.6.9 win32). 我已经在名为dest (v0.6.9 win32)的py2exe输出目录之外创建了我的Inno Setup(v5.5.5)。

Py2exe output dest contains one dir named tcl which contains files and subfolders. Py2exe输出dest包含一个名为tcl目录,该目录包含文件和子文件夹。 So in your Inno Setup script add the following entry to the [Files] section: 因此,在您的Inno Setup脚本中,将以下条目添加到[Files]部分:

Source: dest\tcl\*; DestDir: "{app}\tcl"; Flags: createallsubdirs recursesubdirs

In my case currentWorkingdir\\ is added to dest\\tcl\\* . 在我的情况下, currentWorkingdir\\被添加到dest\\tcl\\* This gets everything and sends it to DestDir: "(app)\\tcl\\" which gets the files and folders. 这将获取所有内容并将其发送到DestDir: "(app)\\tcl\\" ,该文件将获取文件和文件夹。

Flags createallsubdirs and recursesubdirs does all the work. 标志createallsubdirsrecursesubdirs完成所有工作。 This is an excerpt from help: 这是帮助的摘录:

createallsubdirs createallsubdirs

By default the compiler skips empty directories when it recurses subdirectories searching for the Source filename/wildcard. 默认情况下,编译器递归搜索源文件名/通配符的子目录时会跳过空目录。 This flag causes these directories to be created at install time (just like if you created [Dirs] entries for them). 此标志导致在安装时创建这些目录(就像为它们创建[Dirs]条目一样)。

Must be combined with recursesubdirs. 必须与recursesubdirs结合使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM