TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.33k stars 1.07k forks source link

Error when using Auto Py to Exe #2349

Closed Candleholder closed 5 months ago

Candleholder commented 6 months ago

So, I am trying to convert my script to an .exe; however, I am running into an issue where it is saying that I don't have the tkinter package. I am using pycharm.

Anyways, I have followed the documentation, I am using One directory, I am using window based, I also included the folder for customtkinter. I don't understand what issue I am running into. The only possible issue I can think of is that my packages are installed within a .venv folder. '.venv/Lib/site-packages/customtkinter'

Screenshot 2024-04-02 205634

Edit: Turns out someone else had this same problem, sorry for making two posts for it, I didn't find it the first time around. I've fixed it, but it seems that it is still struggling to find other packages. I've had to import distutils, and once that passed, its now asking me to import font from tkinter. Is there anything I can do so that I don't have to keep importing these?

Edit 2: Okay, so, I just brute forced it essentially, I just kept on doing add data, and importing what it wanted me to until it finally started working. Now, I'm running into the issue where it can't find my images. So, I'm guessing this is just one big issue where when I'm extracting this stuff, it is losing where the images are located, and where the packages are located, and pretty much everything. So, is there a fix to that? Something I can do where I won't have to manually force everything back into place?

Edit 3: So, did more digging around, and found that there is this guide. (https://github.com/TomSchimansky/CustomTkinter/discussions/939). I highly recommend it; however, it hasn't helped me in my case. I used the resource function, and I made sure to include it in every spot an image is needed, or a filepath is required. When I compile my script normally it functions great, but the .exe is still struggling.

Edit 4: Okay, so I'm not going to delete this incase someone else has the same problem I do. What I did was I went to youtube https://www.youtube.com/watch?v=Ko8w4qeYrN0&ab_channel=clueplec. And I watched his video and it solved all my problems. Just copy and paste the stuff needed into the folder. If there is a cleaner solution though, it would be nice to see it

Akascape commented 6 months ago

@Candleholder You can also find resources here in #939 related to pyinstaller/auto py to exe

Candleholder commented 5 months ago

So, the issue is as it is, and I think it’s as closed as it possibly can be, so in favor of not beating a dead horse I’m gonna close it.

Candleholder commented 5 months ago

@Candleholder You can also find resources here in #939 related to pyinstaller/auto py to exe

Thank you for the heads up, and sorry for taking so long to reply, but honestly, for anyone finding this down the line. Yeah, the link he has goes hard. It’s also in my edit, I found it and it does work. It’s just not as… nice as I’d like it to be