Open jjstickel opened 7 months ago
Just checking - did you rebuild PyCall each time you changed the PYTHON env var?
Just checking - did you rebuild PyCall each time you changed the PYTHON env var?
Yes. I repeated going back and forth just now, rebuilding PyCall each time, to confirm.
Can you do juliapkg.status()
and jl.PythonCall.C.CTX
each time to check they are configured how we expect?
Can you also check if PyCall works on its own in Julia using both these Python interpreters?
Can you do
juliapkg.status()
andjl.PythonCall.C.CTX
each time to check they are configured how we expect?
$ /usr/local/bin/python3.11
Python 3.11.5 (main, Nov 25 2023, 15:23:23) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from juliacall import Main as jl
>>> jl.Pkg.stat
jl.Pkg.stat( jl.Pkg.status(
>>> jl.Pkg.status()
Status `~/.julia/environments/pyjuliapkg/Project.toml`
[438e738f] PyCall v1.96.2
[6099a3de] PythonCall v0.9.15
>>> jl.PythonCall.C.CTX
Julia:
IOContext{IOBuffer}:
is_embedded = true
is_initialized = true
is_preinitialized = false
lib_ptr = Ptr{Nothing} @0x00007fefde5b52e0
exe_path = "/usr/local/bin/python3.11"
lib_path = missing
dlopen_flags = 0x00000046
pyprogname = missing
pyprogname_w = missing
pyhome = missing
pyhome_w = missing
which = :embedded
version = v"3.11.5"
matches_pycall = missing
$ /usr/bin/python3.10
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from juliacall import Main as jl
>>> jl.Pkg.status()
Status `~/.julia/environments/pyjuliapkg/Project.toml`
[438e738f] PyCall v1.96.2
[6099a3de] PythonCall v0.9.15
>>> jl.PythonCall.C.CTX
Julia:
IOContext{IOBuffer}:
is_embedded = true
is_initialized = true
is_preinitialized = false
lib_ptr = Ptr{Nothing} @0x00007fb3c422b2e0
exe_path = "/usr/bin/python3.10"
lib_path = missing
dlopen_flags = 0x00000046
pyprogname = missing
pyprogname_w = missing
pyhome = missing
pyhome_w = missing
which = :embedded
version = v"3.10.12"
matches_pycall = missing
Can you also check if PyCall works on its own in Julia using both these Python interpreters?
Yes, PyCall works from the Julia REPL for both Python interpreters.
Affects: JuliaCall
Describe the bug
Using JuliaCall with Ubuntu 22.04 system python (python-3.10) results in
free(): invalid pointer
crash if a Julia package is imported that also imports/uses PyCall. I suspect this is related to the long standing problem where PyJulia cannot use statically linked python (https://github.com/JuliaPy/pyjulia/issues/185). I have confirmed that installing python compiled with dynamically linked libpython resolves the issue. If so, ultimately it is a bug of PyJulia, but I am reporting it here to alert others who might encounter it. Perhaps a warning or documentation is merited.With dynamically linked libpython: