Not including tkinter for standalone exe
See original GitHub issueCannot create standalone exe for scripts using tkinter.
- nuitka pip installation
- Compiler installed VS 2017
- output of nuitka generation:
Microsoft Windows [Version 10.0.16299.665]
Jorj@ARRAKIS C:\Users\Jorj\Desktop\test
$ python -m nuitka --portable test.py
Jorj@ARRAKIS C:\Users\Jorj\Desktop\test
$ python -m nuitka --version
0.5.33
Python: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
Executable: C:\Users\Jorj\AppData\Local\Programs\Python\Python37\python.exe
OS: Windows
Arch: x86_64
- Script:
import tkinter
root = tkinter.Tk()
root.bbox()
root.bell()
Output when running test.exe:
Jorj@ARRAKIS C:\Users\Jorj\Desktop\test\test.dist
$ test.exe
Traceback (most recent call last):
File "C:\Users\Jorj\Desktop\test\test.dist\test.py", line 2, in <module>
File "C:\Users\Jorj\Desktop\test\test.dist\tkinter\__init__.py", line 2020, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{C:\Users\Jorj\AppData\Local\Programs\Python\Python37\tcl} C:/Users/Jorj/AppData/Local/Programs/Python/Python37/tcl8.6 C:/Users/Jorj/Desktop/test/lib/tcl8.6 C:/Users/Jorj/Desktop/test/lib/tcl8.6 C:/Users/Jorj/Desktop/lib/tcl8.6 C:/User
s/Jorj/Desktop/test/library C:/Users/Jorj/Desktop/library C:/Users/Jorj/Desktop/tcl8.6.8/library C:/Users/Jorj/tcl8.6.8/library
This probably means that Tcl wasn't installed properly.
Problem goes away when I (e.g.) copy the two directories C:\Users\Jorj\AppData\Local\Programs\Python\Python37\tcl\tcl8.6
and C:\Users\Jorj\AppData\Local\Programs\Python\Python37\tcl\tk8.6
side-by side in a common directory called lib
on the same level as test.dist
.
What am I missing / doing wrong?
Issue Analytics
- State:
- Created 5 years ago
- Comments:61 (56 by maintainers)
Top Results From Across the Web
Convert tkinter to EXE - python - Stack Overflow
1. your EXE file is self-uncompressing ZIP file - when you start program then system uncompresses it to random folder and it doesn't...
Read more >Converting Tkinter program to exe file - Tutorialspoint
Converting Tkinter program to exe file - Let us suppose that we want to create a standalone app (executable application) using tkinter.
Read more >Packaging Tkinter applications for Windows, with PyInstaller ...
toc is non existent 10015 INFO: Building EXE from EXE-00.toc 10015 INFO: Copying bootloader EXE to C:\Users\Martin\pyinstaller\tkinter\basic\ ...
Read more >Executable GUI with Python. using Tkinter and Pyinstaller
In this project, we will be building a GUI (graphical user interface) using Tkinter in python. Tkinter is a python's standard GUI tool...
Read more >What PyInstaller Does and How It Does It
You distribute the bundle as a folder or file to other people, and they can execute your program. To your users, the app...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@JorjMcKie Indeed, I’m just concerned about using opensource which may be freely redistributed, hence trying to avoir Microsoft tools here. I think the results are the same:
Yet better, I found a pythonic way to do so
Which produces the same result, without needing subprocess. Going to tweak Standalone.py to use this so we won’t have any more …dependencies (pun intended).
@deajan maybe I am missing a point, but how about using dumbin.exe (Visual Studio) on Windows? Sample output (redirectable to file, tons of other options available)