ClimenteA/pyvan

Packaging a python script that includes PySimpleGUI throws a tkinter error

Closed this issue · 4 comments

The script works fine until I try to package it using pyvan. I had to run the script using "python pyrss.py" to finally track down the error inside the dist directory:

File "C:\pyrss\dist\lib\site-packages\PySimpleGUI\PySimpleGUI.py", line 102, in
import tkinter as tk
ModuleNotFoundError: No module named 'tkinter'

I'm on Win 10x64 with Python 3.8.2

I managed to get further than this with pyinstaller but at some point instead of crashing it spawned a new GUI instance which is very curious since that's not in the code. I'm starting to think going with something simple like PySimpleGUI was too basic for compiling.

Tkinter is not available in embeded Python version.

Add in "include_modules" field: "tkinter"

Tkinter is not available in embeded Python version.

Add in "include_modules" field: "tkinter"

I did that too. It didn't recognize it as a module when compiling, so that didn't work either.

Try to install manually tkinter in python embeded

Check out this issue on stackoverflow:
https://stackoverflow.com/questions/37710205/python-embeddable-zip-install-tkinter

Thanks! I didn't realize it wasn't in the embedded python zip. Also, I realized I was copying 64 bit Python installation files into a 32 bit environment, and once I resolved that afterward, it seemed to build correctly. I'm running the compiled script now, seems to be working!