JuliaPy / JuliaPy/PyCall.jl

conversion of SymPy integer to Julia Int fails under Miniconda3

Offen
#398 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
1.5k
Forks
186
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I cannot convert a `SymPy.jl` integer to Julia (v0.5.2 and v0.6-rc2, 64bit) integer:
```
julia> using SymPy

julia> Int(Sym(1))
ERROR: PyError (PyInt_AsSsize_t)
TypeError('an integer is required',)

in pyerr_check at /home/michele/.julia/v0.5/PyCall/src/exception.jl:56 [inlined]
in convert(::Type{Int64}, ::PyCall.PyObject) at /home/michele/.julia/v0.5/PyCall/src/conversions.jl:31
in Int64(::SymPy.Sym) at ./sysimg.jl:53
```
but the conversion to Float64, `Float64(Sym(0))` works.

`PyCall` uses the Miniconda3 installation on the path:
```
julia> Pkg.build("PyCall")
INFO: Building Conda
INFO: Building PyCall
INFO: PyCall is using python (Python 3.6.0) at /home/michele/local/miniconda3/bin/python, libpython = /home/michele/local/miniconda3/lib/libpython3.6m
INFO: /home/michele/.julia/v0.5/PyCall/deps/deps.jl has been updated
INFO: /home/michele/.julia/v0.5/PyCall/deps/PYTHON has been updated
```
The conversion to Julia's integer works using `Miniconda2` and `Conda.jl`.

Ref: JuliaPy/SymPy.jl#159

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with the conversion path shown in PyCall/src/conversions.jl:31 and reproduce Int(Sym(1)) using Julia with the Miniconda3 Python selected by Pkg.build("PyCall"). Compare the failing integer conversion with the working Float64 conversion and the reported Miniconda2 behavior; done means the Julia integer conversion succeeds under Miniconda3.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
julia, python
Bereich
developer-experience
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.