uqfoundation / dill

serialize all of Python
http://dill.rtfd.io
Other
2.24k stars 178 forks source link

Use dump_module() in jupyter notebook with remote kernel #636

Open nadavv169 opened 8 months ago

nadavv169 commented 8 months ago

I have a jupyter notebook with Jupyter Enterprise Gateway architecture and i am trying to use the dump_module() function in my notebook but i'm getting the error:

TypeError: <IPython.core.interactiveshell.DummyMod object at .... is not a module

I tried to run the same function in jupyter notebook without remote kernel and it worked, so i assume the issue is with the remote-kernel.

any ideas to solution?

relevant packages versions: dill==0.3.7 ipython==7.34.0 ipykernel==5.5.6 jupyter-enterprise-gateway==3.2.2

mmckerns commented 8 months ago

Can you post a simple example code that reproduces the issue you are seeing?

linzhe138 commented 1 month ago

I have the same problem, error like below:

TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dill.dump_module(filename=file_path)

File ~/anaconda3/lib/python3.11/site-packages/dill/session.py:222, in dump_module(filename, module, refimported, **kwds) 220 main = _import_module(main) 221 if not isinstance(main, ModuleType): --> 222 raise TypeError("%r is not a module" % main) 223 if hasattr(filename, 'write'): 224 file = filename

TypeError: <IPython.core.interactiveshell.DummyMod object at 0x7fca253708d0> is not a module

linzhe138 commented 1 month ago

image