#๐Ÿ”’ Compile 3 Python Files Using Pyinstaller

14 messages ยท Page 1 of 1 (latest)

flint nebula
#

So I have 3 files of code
This code requried some massive pip installs though
So when compile it, the file is like 3gb

Below is the .spec I used:

a = Analysis(
    ['app.py'],
    pathex=[],
    binaries=[],
    datas=[],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    noarchive=False,
    optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    [],
    name='app',
    debug=True,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)

And the command:

PyInstaller AeroHelper.spec
proud stumpBOT
#

Hey @flint nebula!

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!')```
proud stumpBOT
#

@flint nebula

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.

primal citrus
#

Python is not meant to be distributed as an exe , therefore any existing solutions such as pyinstaller will do hacks things to make it work, for example; pyinstaller will grab the Python exe itself, and then any dependencies your script needs, and bundle it into an zip folder which it then converts into an executable file, so the final executable will contain Python itself, plus all the dependencies into a single file which means that if any of your dependencies are quite big, then the final executable will have a quite large file size

primal citrus
#

@flint nebula ^

flint nebula
#

Hmm

#

Then what can I do?

#

Can I do sm where it downloads the dependencies

#

Cuz Iโ€™m not switching languages

#

AFK to bed btw
Will read in morning

primal citrus
proud stumpBOT
#
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.