If I run the following code in a Julia (1.12.1) terminal, all fine:
using Pkg
cd(@__DIR__)
Pkg.activate(;temp=true)
Pkg.add("CondaPkg") # only once
import CondaPkg # only once
CondaPkg.add("ezodf") # only once
Pkg.add("PythonCall")
using PythonCall
const ez = pyimport("ezodf")
dest_doc = ez.newdoc(doctype="ods", filename="an_ods_sheet.ods")
But if I run it in VSCode, I got a very quick "error/full stack’, followed by a crash of Julia.
What’s wrong with it ?
EDIT
I have set VSCode to use /home/me/.juliaup/bin/julia --handle-signals=yes 2>/home/me/juliacrash.log but still I can’t get the crash log…
The ez object, both on VSCode and Terminal, seems fine:
julia> ez
Python: <module 'ezodf' from '/tmp/jl_2ftHfg/.CondaPkg/.pixi/envs/default/lib/python3.14/site-packages/ezodf/__init__.py'>
But then working with it will crash Julia, only in VSCode. Why?
I managed to get a screenshot before it went off:
EDIT: In Jupyter Notebook (in VSCode) it works:
Claude says:
The stacktrace is very clear. The crash is caused by PythonCall + a Python library (ezodf) interacting badly inside the VS Code Julia process.
What’s happening
The crash originates here (top of your code):
const ez = pyimport(“ezodf”)
dest_doc = ez.newdoc(doctype=“ods”, filename=“…”)
The stacktrace shows Julia crashing deep inside CPython internals (PyEval_EvalFrame, PyFunction_Vectorcall, etc.), called through PythonCall.jl. This is a segfault inside the embedded Python interpreter.
Why it works in a terminal but not VS Code
The VS Code Julia extension already loads its own Python environment for the language server. When your code then tries to load ezodf through PythonCall, there’s a conflict between two Python environments — the one VS Code initialized and the one PythonCall is trying to use (your Conda env at /tmp/jl_K6Pb5t/.CondaPkg/…).
Hower, the solutions it propose don’t work :-//