JuliaPy / PythonCall.jl

Python and Julia in harmony.
https://juliapy.github.io/PythonCall.jl/stable/
MIT License
776 stars 63 forks source link

support "dill" for serialization and deserialization #424

Closed schlichtanders closed 4 months ago

schlichtanders commented 10 months ago

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.

cjdoris commented 10 months ago

Agreed this would be a nice feature.

ma-sadeghi commented 7 months ago

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

ma-sadeghi commented 7 months ago

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

cjdoris commented 4 months ago

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