-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
JuliaPy/PyCall.jl
#937Description
In Python >= 3.9, Julia(compiled_modules=False)
fails with
JuliaError: Exception 'LoadError' occurred while calling julia code:
const PyCall = Base.require(Base.PkgId(Base.UUID("438e738f-606a-5dbb-bf0a-cddfbfd45ab0"), "PyCall"))
With Julia(debug=True, compiled_modules=False)
, it shows
┌ Error: Failed to import PyCall
│ exception =
│ LoadError: could not load symbol "main":
│ /.../bin/python: undefined symbol: main
│ Stacktrace:
│ [1] #dlsym#1
│ @ ./libdl.jl:59 [inlined]
│ [2] dlsym(hnd::Ptr{Nothing}, s::Symbol)
│ @ Base.Libc.Libdl ./libdl.jl:57
│ [3] top-level scope
│ @ ~/.julia/packages/PyCall/ScKXc/src/startup.jl:76
│ [4] include(mod::Module, _path::String)
│ @ Base ./Base.jl:420
│ [5] include(x::String)
│ @ PyCall ~/.julia/packages/PyCall/ScKXc/src/PyCall.jl:1
│ [6] top-level scope
│ @ ~/.julia/packages/PyCall/ScKXc/src/PyCall.jl:38
│ [7] include
│ @ ./Base.jl:420 [inlined]
│ [8] _require(pkg::Base.PkgId)
│ @ Base ./loading.jl:1149
│ [9] require(uuidkey::Base.PkgId)
│ @ Base ./loading.jl:1013
│ [10] top-level scope
│ @ none:3
│ in expression starting at /home/runner/.julia/packages/PyCall/ScKXc/src/startup.jl:41
│ in expression starting at /home/runner/.julia/packages/PyCall/ScKXc/src/PyCall.jl:1
└ @ Main none:5
Note that lines 41 to 76 as mentioned in the stack trace have this code:
41 if !symbols_present
42 # Python not present. Use deps.jl
...
58 else
59 @static if Sys.iswindows()
...
72 else
73 libpy_handle = proc_handle
74 # Now determine the name of the python library that these symbols are from
75 some_address_in_libpython = Libdl.dlsym(libpy_handle, :Py_GetVersion)
76 some_address_in_main_exe = Libdl.dlsym(proc_handle, Sys.isapple() ? :_mh_execute_header : :main)
Since the system image compilation script uses --compiled-modules=no
for Julia >= 1.5, this also breaks python3 -m julia.sysimage sys.so
.
For full traces of this failure mode in CI, see: #458 (comment)
Metadata
Metadata
Assignees
Labels
No labels