JuliaPy / JuliaPy/PythonCall.jl
Two calls needed to pyimport a module in Julia, the first one crashes
- Lenguaje dominante
- Julia
- Estrellas
- 1.1k
- Forks
- 86
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 3
Descripción
**Affects:** PythonCall
I installed sagelib using CondaPkg in Julia:
`pkg> conda add sagelib`
But importing it requires two calls for sage.all. Here is a Julia session:
```
┌──(greg㉿ellipse)-[~]
└─$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.11.7 (2025-09-08)
_/ |\__'_|_|_|\__'_| |
|__/ |
julia> using PythonCall
julia> sg=pyimport("sage.all")
ERROR: Python: TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object
Python stacktrace:
[1] signal
@ signal ~/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.12/signal.py:58
[2] cysignals.pysignals.setsignal
@ cysignals/pysignals.pyx:319
[3] cysignals.pysignals.changesignal.__exit__
@ cysignals/pysignals.pyx:373
[4] init cysignals.pysignals
@ cysignals/pysignals.pyx:488
[5] init sage.interfaces.process (build/cythonized/sage/interfaces/process.c:7112)
@ sage/interfaces/process.pyx:24
[6]
@ ~/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/sage/parallel/use_fork.py:22
[7]
@ ~/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py:33
[8]
@ ~/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/sage/dynamics/arithmetic_dynamics/projective_ds.py:66
[9]
@ ~/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/sage/dynamics/arithmetic_dynamics/all.py:5
[10]
@ ~/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/sage/dynamics/all.py:25
[11]
@ ~/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/sage/all.py:127
Stacktrace:
[1] pythrow()
@ PythonCall.Core ~/.julia/packages/PythonCall/mkWc2/src/Core/err.jl:77
[2] errcheck
@ ~/.julia/packages/PythonCall/mkWc2/src/Core/err.jl:10 [inlined]
[3] pyimport(m::String)
@ PythonCall.Core ~/.julia/packages/PythonCall/mkWc2/src/Core/builtins.jl:1458
[4] top-level scope
@ REPL[2]:1
julia> sg=pyimport("sage.all")
Python:
julia> sg.factor(sg.ZZ(376655555555555555554444444444443332346777712))
Python: 2^4 * 53 * 163 * 12391 * 219914853701821004027468433435262943
julia> sg.log(2.3)
Python: 0.832909122935104
```
Kali Linux on WSL
PythonCall v0.9.28
CondaPkg v0.2.33
Python version:
Python: '3.12.11 | packaged by conda-forge | (main, Jun 4 2025, 15:10:57) [GCC 13.3.0]'
sagelib v10.7
I wonder what happens here since in pure Python that works.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start with the pyimport entry point and error-handling paths named in PythonCall.Core/builtins.jl, then reproduce the first and second imports using the reported Julia, PythonCall, CondaPkg, and sagelib versions. Done means the first pyimport("sage.all") succeeds without the signal-handler TypeError and the existing functionality remains usable.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- julia, python
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100