Any working way to call Python from Julia compiled app?

I tried to compile a relocatable app with PackageCompiler.create_app and call Python from it.

  1. With PyCall.jl - there is a problem that compiled binary has an absolute path to python library on dev machine (on my Windows machine it is C:\Users\gvg\.julia\conda\3\python39.dll), so when I’m on another machine with different user - it can’t find the python by this path. See issue here: Could not load python library when run from compiled julia app on another machine · Issue #981 · JuliaPy/PyCall.jl · GitHub
  2. With PythonCall.jl - there is another error after compilation, looks like it can’t find Manifes.toml in compiled project files. See issue here: Trouble with runing an app which uses PythonCall · Issue #146 · cjdoris/PythonCall.jl · GitHub

Any other ways I’ve missed?
With option 1, maybe I can set another python path before compilation, so it is not bound to a specific user?

I’m also finding PythonCall and PackageCompiler not working well together. It doesn’t use the JULIA_PYTHONCALL_EXE environment variable when compiled. For large sysimage with all packages included, it failed all together when starting julia with the compiled image:

fatal: error thrown and no exception handler available.
InitError(mod=:C, error=AssertionError(msg=“CTX.which == :PyCall”))
#34 at …julia\packages\PythonCall\XgP8G\src\cpython\context.jl:135
with_gil at …julia\packages\PythonCall\XgP8G\src\cpython\gil.jl:10 [inlined]
with_gil at …julia\packages\PythonCall\XgP8G\src\cpython\gil.jl:9 [inlined]
init_context at …julia\packages\PythonCall\XgP8G\src\cpython\context.jl:132
init at …julia\packages\PythonCall\XgP8G\src\cpython\CPython.jl:21
jfptr___init___70514 at …\julia\ (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1788 [inlined]
jl_module_run_initializer at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:73
_finish_julia_init at /cygdrive/c/buildbot/worker/package_win64/build/src\init.c:796
jl_repl_entrypoint at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:695
mainCRTStartup at /cygdrive/c/buildbot/worker/package_win64/build/cli\loader_exe.c:42
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)

I’ve rencently got PyCall.jl portable by replacing the dll finding process with reading environment variables.

Conda.jl is harder to get work. I left it remain the wrong configs (local configs), but replacing all related variables with reading references which will be setup when __init__ PyCall module.