[Python] python - nuitka: Using --onefile together with --windows-onefile-tempdir-spec

Discussão em 'Python' iniciado por Stack, Julho 6, 2025.

  1. Stack

    Stack Membro Participativo

    could anybody please help me with this. (Windows 10 environment)

    I am trying to compile a python program (hello.py) with the --onefile option.

    python -m nuitka --onefile hello.py


    This works very well.

    Now, I wish to put the files, which hello.exe unpacks, not into the default ...temp... folder but in a folder selected by me, for example into C:\myFolder

    The nuitka documentation tells us to use --windows-onefile-tempdir-spec=... and/or --onefile-tempdir-spec=...

    But I cannot get it to work neither with nuitka 2.6 nor 2.7.

    python -m nuitka --onefile --onefile-tempdir-spec=C:\myFolder hello.py


    I always get the error message:

    "__main__.py: error: The '--onefile-tempdir-spec' option requires
    an argument with '--onefile-tempdir-spec='"


    Does anybody know, how to do this?

    The content of hello.py:

    def myMain():
    print("hello")

    if __name__ == "__main__":
    myMain()

    Continue reading...

Compartilhe esta Página