Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pyinstaller/MEIPASS issues
#1
I'm having a terrible time trying to incorporate getting to the temp MEIPASS file in this section for bundling with Pyinstaller. Pyinstaller makes the exe, but it fails when running. It isn't finding the .gif files. Any changes to the "for i xrange" section causes indent errors. Any incorporation of os.path.join(sys._MEIPASS, relative) anywhere causes errors also. Is there a better way to do the button .gif files to incorporate MEIPASS? (Code also uses Tkinter.)

    def addConfigBtn(self, login):
        # Creating temp references to images using temp1,2,3 so as to disallow
        # garbage collection problems
        btnList = ["Add", "List", "Search"]
        btnCmdList = [lambda: Add.AddWindow(self),
                      lambda: List.ListWindow(self),
                      lambda: Search.SearchWindow(self)]
        f =  # Frames array
        img =  # image array
        self.temp =  # temp array
        
        for i in xrange(3):
            f.append(Frame(login, padx=2, width=50, height=50))
            f[i].grid(row=3, column=i)
            img.append(PhotoImage(
                file=btnList[i] + ".gif", width=48, height=48))
            self.temp.append(img[i])
            ttk.Button(f[i], image=img[i], text=btnList[i], compound="top",
                       style="Submit.TButton",
                       command=btnCmdList[i]).grid(sticky="NWSE")
[/i][/i][/i][/i][/i][/i][/i]
Reply
#2
Here is where the original code came from: https://github.com/mukkachaitanya/Password-Manager

I want to bundle with Pyinstaller to a stand alone exe without the python files accessible. Having issues making the code find the associated files and gifs when running from a bundled exe.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Compiling (PyInstaller issues) TheHolyPyGrenade 1 1,930 Apr-11-2021, 08:30 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020