JuliaPy / JuliaPy/PyCall.jl

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

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

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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