#๐Ÿ”’ .py to .exe issue

29 messages ยท Page 1 of 1 (latest)

flint charm
#

Hello there! I struggle a lot with converting a .py to an .exe.
I have a Minecraft sound extractor in here and no matter if i bundle ffmpeg, ffprobe and patch_subprocess, the .exe won't work for others if they won't have these files idk what to do honestly.
Here the code itself and the patch_subprocess.py
Help pls:_)

patch_subprocess.py:



class NoWindowPopen(subprocess.Popen):
    def __init__(self, *args, **kwargs):
        startupinfo = subprocess.STARTUPINFO()
        startupinfo.dwFlags = subprocess.CREATE_NEW_CONSOLE | subprocess.STARTF_USESHOWWINDOW
        startupinfo.wShowWindow = subprocess.SW_HIDE

        kwargs["startupinfo"] = startupinfo
        super().__init__(*args, **kwargs)


subprocess.Popen = NoWindowPopen```
light duneBOT
#

Hey @flint charm!

Please edit your message to use a code block

Add a py after the three backticks.

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
light duneBOT
#

@flint charm

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

ionic oak
#

seems ffmeg.exe not the only file ... mabye you need to add the whole ffmpeg folder

flint charm
#

i added ffmpeg.exe and ffprobe.exe, there's another one ffplay.exe but i don't know if the code uses it

flint charm
#

the ffmpeg.exe and the other .exe

#

oh actually i think i tried both

ionic oak
flint charm
#

the thing is the final .exe wil work for others only if they have ffmpeg.exe, ffprobe.exe and patch_subprocess.py

#

but i bundled them and it still won't work

ionic oak
#

hmmm okay ... but than you must put an information where is standard path for ffmeg on OS (dont know how exactly) but i think so

flint charm
#

all the files are in the same file as the script

ionic oak
#

yes but ffmeg.exe i think is not a standalone file ... but only this one is add to your compiled exe

flint charm
#

idk basically the bundling doesn't work for some reason

ionic oak
#

try with pyinstaller and add the exe to hidden-import

flint charm
#

yeah tried this too, still didn't work

ionic oak
#

always compiling isnt that easy if you have external stuff^^

flint charm
#

yeah...

ionic oak
#

if you are shure that only exe is important try both once exe unpack in same folder your exe and once in main-temp-folder

flint charm
#

Yeah both are important, i tried to delete each from another pc and it doesn't work

#

The thing works as long the .exe are with the final program

grand wyvern
#

Auto py to exe is just a front end for pyinstaller

#

Also pyinstaller is not a compiler

flint charm
#

Alr I'll just have it as a zip folder with a few files in it

#

I'm sooo done with it, I'm good with what I have

light duneBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.