20

Python embeddable zip comes without pip and Tkinter.
It is easy to install pip with get-pip.py in the embeddable zip.

How can we install Tkinter too (assuming we do not have an existing Python installation in the same machine)?

Community
  • 1
  • 1
antonio
  • 9,910
  • 11
  • 64
  • 121

1 Answers1

22

Assuming you are on Windows and you also have a regular Python distribution installed (same version of the embedded distribution), to install Tkinter in the embedded distribution you can copy the following files from the regular Python distribution:

  • tcl folder to embedded_distribution_folder\ (root folder of the embedded distribution)
  • tkinter folder (which is under Lib) either to embedded_distribution_folder\Lib or to embedded_distribution_folder\
  • files _tkinter.pyd tcl86t.dll tk86t.dll (which are under DLLs) either to embedded_distribution_folder\DLLs or to embedded_distribution_folder\
lucatrv
  • 595
  • 4
  • 13
  • this solution worked for me while working with Robot Editor and embedded python 3.6.5. thanks @lucatrv – Jitendra Jan 26 '19 at 17:05
  • 5
    After copying the files I've got the error: "import _tkinter # If this fails your Python may not be configured for Tk ModuleNotFoundError: No module named '_tkinter'" It appears that I needed to add the line ".\DLLs" to the python36._pth file. I hope this helps anyone that has the issue. – TeaHoney Jul 01 '19 at 04:32
  • 3
    Adding on @TeaHoney s fix, moving the `tkinter` folder to `embedded_distribution_folder\ ` (the root folder) was required – Harald Thomson Dec 10 '19 at 15:23
  • It's helpful for me, thanks @TeaHoney and Harald Thomson. When you get stuck, please reference these two suggestions. – Carson Mar 17 '20 at 10:28