`using Pycall` on Google Colab makes Julia runtime crash

funatsufumiya
Wed, 15 Apr 2026 02:50:01 +0000
New to Julia

I’d like to use PyCall on Google Colab Julia runtime, but not succeeded.

import Pkg; Pkg.add("PyCall") works, however, using PyCall would crash.

run(which python) shows /usr/local/bin/python, run(which pip) shows /usr/local/bin/pip.

Log:

using PyCall

[4775] signal 11 (1): Segmentation fault
in expression starting at none:1
PyObject_GC_Del at /usr/lib/x86_64-linux-gnu/libpython3.12.so.1.0 (unknown line)
unknown function (ip: 0x7b351392224c)
pydecref_ at /root/.julia/packages/PyCall/1gn3u/src/PyCall.jl:118
pydecref at /root/.julia/packages/PyCall/1gn3u/src/PyCall.jl:123
jfptr_pydecref_4467 at /root/.julia/compiled/v1.11/PyCall/GkzkC_0abgj.so (unknown line)
run_finalizer at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/gc.c:303
jl_gc_run_finalizers_in_list at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/gc.c:393
run_finalizers at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/gc.c:439
jl_mutex_unlock at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/julia_locks.h:80 [inlined]
jl_generate_fptr_impl at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/jitlayers.cpp:545
jl_compile_method_internal at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/gf.c:2536 [inlined]
jl_compile_method_internal at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/gf.c:2423
ijl_compile_method_instance at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/gf.c:2860
ijl_compile_hint at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/gf.c:2873

I also tried below, but nothing fixed.

ENV["PYTHON"] = "/usr/local/bin/python"
import Pkg; Pkg.add("PyCall"); Pkg.build("PyCall")

4 posts - 2 participants