JuliaPy / JuliaPy/PyCall.jl

`PyError (:PyObject_Call) None` when accessing python method in a worker process

Open
#400 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

```
julia> Pkg.status("PyCall")
- PyCall 1.7.2 pinned.be354e07.tmp
julia> VERSION
v"0.4.5"
```

I'm using a python database library to connect to a database from Julia. Everything works correctly when I use the library from main process, but if I start a worker process using `addprocs` and try to call the method from the worker, I get a `PyError (:PyObject_Call) None` and I don't understand why.

The code in question looks like this:

```
println(typeof(cursor[:execute]))
cursor[:execute](sql, params)
```

The `println` prints `From worker 2: PyCall.PyObject`
The call to `:execute` throws:
```
On worker 2:
PyError (:PyObject_Call) None

[inlined code] from /home/ubuntu/.julia/v0.4/PyCall/src/exception.jl:81
in _pycall at /home/ubuntu/.julia/v0.4/PyCall/src/PyCall.jl:546
in pycall at /home/ubuntu/.julia/v0.4/PyCall/src/PyCall.jl:568
in call at /home/ubuntu/.julia/v0.4/PyCall/src/PyCall.jl:571
in getDataID at In[65]:12
in anonymous at multi.jl:923
in run_work_thunk at multi.jl:661
[inlined code] from multi.jl:923
in anonymous at task.jl:63

in remotecall_fetch at multi.jl:747
in remotecall_fetch at multi.jl:750
```

(`getDataID at In[65]:12` is the call to execute)

I've also verified that both `sql` and `params` contain the right values.

Does anyone know why I'd be getting the above error or where I'd look to debug it?

I've also tried using `pycall(cursor[:execute], PyObject, sql, params)` with the same result.

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.