JuliaPy / JuliaPy/PyCall.jl

conversion of SymPy integer to Julia Int fails under Miniconda3

Open
#398 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
1.5k
Forks
186
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.