JuliaPy / JuliaPy/PythonCall.jl

Two calls needed to pyimport a module in Julia, the first one crashes

Ouverte
#681 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Julia
Étoiles
1.1k
Forks
86
Merge moyen
1 j 22 h
PR mergées (30 j)
3

Description

**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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.