pyjulia icon indicating copy to clipboard operation
pyjulia copied to clipboard

Failure when executing a executable builded by pyinstaller

Open timacro opened this issue 3 years ago • 0 comments

I'm trying to use pyinstaller to build a executable with pyjulia, here is my code:

from julia import Main

def hello(u = "world"):
    Main.println(f"hello {u}!")

hello()

This works good in REPL, but runs into a error after pack it into a executable using pyinstaller:

PS D:\codehub\Instrument.jl\EC22.jl\temp\dist\hello> .\hello.exe
Traceback (most recent call last):
  File "hello.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 632, in _load_backward_compatible
  File "julia\core.py", line 247, in load_module
  File "julia\core.py", line 149, in __init__
  File "julia\core.py", line 239, in julia
  File "julia\core.py", line 468, in __init__
  File "julia\juliainfo.py", line 87, in load
subprocess.CalledProcessError: Command '['julia', '-e', '...']' returned non-zero exit status 1.
[14612] Failed to execute script 'hello' due to unhandled exception!

timacro avatar Jan 05 '22 07:01 timacro