Nuitka doesn't get along with PySimpleGUI: `CALL_FUNCTION_WITH_ARGS14' error

Question:

I try to make an EXE on windows with Nuitka but always get error like this: CALL_FUNCTION_WITH_ARGS14

I googled ‘CALL_FUNCTION_WITH_ARGS14’ but nothing shows up. Does anyone have similar issue?

I am using Python 3.9 and 3.10 and this is my command

nuitka --standalone --onefile --mingw64 --show-memory --show-progress --follow-imports --output-dir=out Demo_Hello_World.py

The Demo_Hello_World.py is from PySimpleGUI/DemoPrograms/Demo_Hello_World.py

     ValueTraceLoopComplete 38798 30843 7955
     ValueTraceLoopIncomplete 16811 14635 2176
     ValueTraceMerge 470835 399699 71136
     ValueTraceUninitialized 82073 66112 15961
     ValueTraceUnknown 238500 209701 28799
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:INFO: Backend linking program with 14 modules (no progress information available).
module.PySimpleGUI.PySimpleGUI.c: In function 'impl_PySimpleGUI$PySimpleGUI$$$function__578__github_issue_post_make_markdown':
module.PySimpleGUI.PySimpleGUI.c:549680:35: warning: implicit declaration of function 'CALL_FUNCTION_WITH_ARGS14'; did you mean 'CALL_FUNCTION_WITH_ARGS10'? [-Wimplicit-function-declaration]
549680 |             tmp_assign_source_2 = CALL_FUNCTION_WITH_ARGS14(unicode_builtin_format, args);
       |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
       |                                   CALL_FUNCTION_WITH_ARGS10
module.PySimpleGUI.PySimpleGUI.c:549680:33: warning: assignment to 'PyObject *' {aka 'struct _object *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
549680 |             tmp_assign_source_2 = CALL_FUNCTION_WITH_ARGS14(unicode_builtin_format, args);
       |                                 ^

Nuitka-Scons:INFO: Running 'C:\Users\nytrg\AppData\Local\Nuitka\Nuitka\gcc\x86_64\11.3.0-14.0.3-10.0.0-msvcrt-r3\mingw64\bin\gcc.exe -o "F:\PySimpleGUI\DemoPrograms\out\Demo_Hello_World.dist\Demo_Hello_World.exe" -fuse-linker-plugin -flto=6 -fpartial-inlining -freorder-functions -Wl,--exclude-all-symbols -Wl,--out-implib,.\import.lib -municode -O3 -s -Wl,--enable-auto-import -Wl,--stack,9863168 -static-libgcc @".\@link_input.txt" -LC:\Users\nytrg\AppData\Local\Programs\Python\Python39\libs -lm -lpython39' took 164.76 seconds
c:/users/nytrg/appdata/local/nuitka/nuitka/gcc/x86_64/11.3.0-14.0.3-10.0.0-msvcrt-r3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:UsersnytrgAppDataLocalTempcccIcn6f.ltrans80.ltrans.o:<artificial>:(.text+0x32b8): undefined reference to `CALL_FUNCTION_WITH_ARGS14'
collect2.exe: error: ld returned 1 exit status

scons: *** [F:PySimpleGUIDemoProgramsoutDemo_Hello_World.distDemo_Hello_World.exe] Error 1
Asked By: user3345156

||

Answers:

I had the same problem and the only thing that helped me was compiling in a clean Python venv, the issue may be due to some package conflict but requires further investigation.

So to sum that up:

  1. Create a clean venv
  2. Activate the venv using the appropriate script (Refer to the table below)
    Activate script table
  3. Install just the necessary prerequisites through pip (including Nuitka of course)
  4. Try compiling with nuitka again
Answered By: Crowfunder

My application, WSA Sideloader is a PySimpleGUI program compiled using Nuitka. This is the command I used:

nuitka --standalone sideloader.py --enable-plugin=tk-inter --windows-disable-console

Of course the name of your main Python file should be used after –standalone.

Note that if it requires other files to function you will need to add them to the dist folder once it’s compiled.

Answered By: dg6
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.