Repository navigation
Python package works on Julia 1.11 and 1.13 but errors on 1.12 #735
Description
Activity
- addedbugSomething isn't workingSomething isn't workingand removedbugSomething isn't workingSomething isn't working
on Dec 17, 2025 What is
pytype(Py(UInt8[]))in the working/non-working cases.Do you still see the error if you start Julia with
-t1?Is the version of imagecodecs the same in the working/non-working cases?
julia> pytype(Py(UInt8[])) Python: <class 'juliacall.VectorValue'>
In both cases. I have
JULIA_NUM_THREADS = 1env variable set.Interestingly, it sometimes does work on 1.12.3 if I repeat the import four times:
using Pkg Pkg.activate(;temp=true) pkg"add PythonCall CondaPkg" using CondaPkg pkg"conda pip_add imagecodecs" using PythonCall imcd = pyimport("imagecodecs") imcd = pyimport("imagecodecs") imcd = pyimport("imagecodecs") imcd = pyimport("imagecodecs") imcd.lzma_encode(UInt8[])
Ok that's very strange. That hints at a more fundamental bug.
Try this?
x = Py(UInt8[]) imcd.lzma_encode(x)
With help from Claude and Codex I finally think I know what is going on here.
Julia is statically compiling its own internal version of lzma. However it is not the complete liblzma, just a few bits. For some reason I don't understand some of those bits of liblzma in julia leak out and shadow some bits from the full liblzma loaded by the python package.
The result is that the version of liblzma that initializes the encoder is different from the version of liblzma that runs the encoder.
What happens if you run this on each version of Julia?
@ccall lzma_version_number()::UInt32
1.11.9:
50040042
1.12.6:
50020052
1.13.0-rc1:
50080012So it looks like 1.12 is using a much older version of liblzma
I've tested julia 1.12 with the libunwind .so files from JuliaPackaging/Yggdrasil#14113 and that fixes the problem.
- added a commit that references this issue
on Jul 13, 2026
Affects: PythonCall
Describe the bug
I expect the following output when using imagecodecs:
This works on Julia 1.11.8 and Julia 1.13.0-alpha2, but on Julia 1.12.3 I get:
Your system