Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Freeze the resolved interpreter for child processes

Abierto
#796 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
backend

Línea de trabajo

Comienza en src/C/context.jl y sigue cómo getpref_exe y CTX.which gestionan CondaPkg durante el inicio de procesos hijo. Verifica el comportamiento existente controlado por CI y las convenciones de preferencias; después, confirma que los procesos iniciados heredan el ejecutable resuelto sin volver a resolver CondaPkg y que un JULIA_PYTHONCALL_EXE establecido por el usuario permanece sin cambios.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

When PythonCall resolves its interpreter via CondaPkg, each child process that loads
PythonCall re-resolves the same CondaPkg environment from scratch. Spawn several at once —
e.g. Distributed workers for parallel data loading (MLUtils DataLoader(...; num_workers=N)
over a PythonCall-backed dataset) — and they serialize on CondaPkg's lock, spamming
CondaPkg: Waiting for lock to be freed and redoing work the parent already did.

PythonCall already has the fix, but gates it behind CI=true and flags it as a hack
(src/C/context.jl, v0.9.35):

# HACK: If we are using CondaPkg, prevent child processes from using it by explicitly
# setting the executable. ...
# A better solution may be to use some environment variable to "freeze" CondaPkg in
# child processes.
# Only done when CI=true since it's a hack.
if (get(ENV, "CI", "false") == "true") && (CTX.which === :CondaPkg)
    ENV["JULIA_PYTHONCALL_EXE"] = CTX.exe_path::String
end

Since JULIA_PYTHONCALL_EXE is exactly the "freeze" env var the comment asks for (child
processes inherit ENV, and getpref_exe reads it), the same line solves the general case.

Proposal

Set JULIA_PYTHONCALL_EXE whenever CTX.which === :CondaPkg, not only under CI — ideally
behind a preference (e.g. freeze_child_processes, default true) so it can be disabled.
get! already leaves a user-set value untouched.

Workaround

A downstream package can do this itself after init:

if PythonCall.C.CTX.which === :CondaPkg
    get!(ENV, "JULIA_PYTHONCALL_EXE", PythonCall.python_executable_path()::String)
end

I've done this in https://github.com/JuliaGenAI/HuggingFaceDatasets.jl/pull/64

Lenguaje dominante
Julia
Estrellas
1.1k
Forks
89
Merge medio
2 d 15 h
PR fusionados (30 d)
7

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de JuliaPy/PythonCall.jl

Todos los issues de JuliaPy/PythonCall.jl

Issues similares

Más issues de Julia

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.