How can I use pyimport with multiple processes?
So say I want (taken from here <https://github.com/stevengj/PyCall.jl#usage>
)
using PyCall
@pyimport math
math.sin(math.pi / 4) - sin(pi / 4) # returns 0.0
How exactly can I make this work (after launching julia with say 2
processes):
r = @spawn math.sin(math.pi / 4)
fetch(r) - sin(pi / 4) # returns 0.0
Currently I’m getting this error:
WARNING: Module __anon__ not defined on process 2
fatal error on 2: ERROR: UndefVarError: __anon__ not defined
in deserialize at serialize.jl:500
in handle_deserialize at serialize.jl:461
in deserialize at serialize.jl:480
in handle_deserialize at serialize.jl:461
in deserialize at serialize.jl:536
in handle_deserialize at serialize.jl:461
in deserialize at serialize.jl:694
in deserialize_datatype at serialize.jl:647
in handle_deserialize at serialize.jl:461
in message_handler_loop at multi.jl:847
in process_tcp_streams at multi.jl:836
in anonymous at task.jl:63
RemoteRefWorker 2 terminated.{
Channel{ERROR (unhandled task failure): EOFError: read end of file
Any}}(2,1,11)