-2

I have a big Python script for a Voice Assistant app that uses both Pygame and Tkinter as its GUI interfaces (Pygame for creating a splash screen before the main tkinter window starts). The program runs well without throwing any error. Now, I want to convert it into an executable file so that other users can also use it. I had used Pyinstaller but it gives a warning Hidden module pygame._view. Though the .exe file is created but when I open it, it throws an error telling "Failed to execute script Geega" (Geega is name of my Voice Assistant program). Is there any other way so that I can convert this combination of Pygame and tkinter python script into an executable file?

This is the error I am getting when trying to run the .exe file

My code contains 2 png images, 1 icon image, a folder containing frames for animation to be shown in the splash screen and 2 .mp3 files for sound s of acceptance

  • 1
    Have you taken a look at this [answer](https://stackoverflow.com/questions/2136837/process-to-convert-simple-python-script-into-windows-executable/2137143)? – Jeff Gruenbaum Jun 04 '20 at 03:08
  • I have used PyInstaller and auto-py-to-exe. None of them worked! – Soham Chatterjee Jun 04 '20 at 03:13
  • Make sure the image path is correct. – jizhihaoSAMA Jun 04 '20 at 03:16
  • Try auto-py-to-exe, it's a GUI interface for converting .py to .exe files, although this is a duplicate question :/ – mime Jun 04 '20 at 03:48
  • 1
    See [this question](https://stackoverflow.com/questions/57047297/how-to-fix-the-warning-hidden-import-error-pygame-view-not-found-after-i "How to fix the “WARNING: Hidden import” error pygame._view “not found!” after I turned my .py program into .exe?"). It deals with the same problem. You basically have to remove the module from the imports and then manually add it again. – Achyut-BK Jun 04 '20 at 03:24
  • try adding --debug to the pyinstaller command to see what the error is – Red Jun 04 '20 at 03:58

1 Answers1

0

I answered a similar question here.

This code creates a GUI. Everything is written clearly. You only need to install the module cx_Freeze.

If your code needs some other files, put them in the folder build\[your program.exe]\ after conversion.

D_00
  • 1,440
  • 2
  • 13
  • 32
  • Sorry to say but when I am running the application, it is throwing an error – Soham Chatterjee Jun 04 '20 at 12:04
  • If the Command Prompt close faster (less than 10 seconds): Verify that your description contains only `utf-8` characters. If this error persists, delete the description. – D_00 Jun 04 '20 at 14:45
  • If opening the `exe` file returns an error or if you can't open it: 1. Have you checked your `py` file? 2. Have you put the others files (images, `mp3`...) in the folder where is situated the `exe` file? – D_00 Jun 04 '20 at 14:47
  • If you can't run my `py` to `exe` converter: do you have installed `cx_Freeze` ? – D_00 Jun 04 '20 at 14:49