PythonCall.jl icon indicating copy to clipboard operation
PythonCall.jl copied to clipboard

support "dill" for serialization and deserialization

Open schlichtanders opened this issue 2 years ago • 3 comments

I am using PythonCall to define a Python interface from julia. It happens that I want to precompile Python code using Python's compile function and then send it to a remote process (Distributed).

Unfortunately the default serialize_py and deserialize_py use pickle which cannot handle code objects.

Describe the solution you'd like It would be perfect if PythonCall had an option to use dill instead of pickle

Describe alternatives you've considered I am currently overwriting serialize_py and deserialize_py myself to use "dill", and also add "dill" to the CondaPkg.toml.

schlichtanders avatar Nov 21 '23 12:11 schlichtanders

Agreed this would be a nice feature.

cjdoris avatar Nov 22 '23 19:11 cjdoris

@schlichtanders Did you figure this out? If so, would appreciate it if you could share the solution. Thanks!

ma-sadeghi avatar Feb 09 '24 17:02 ma-sadeghi

I think #454 is related, and will be automatically fixed if dill was an option.

ma-sadeghi avatar Feb 09 '24 19:02 ma-sadeghi

This feature is merged to main - you can set JULIA_PYTHONCALL_PICKLE=dill.

cjdoris avatar May 12 '24 19:05 cjdoris