You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure I'm understanding you correctly... in the first case, you have have the class in a local file that you import -- importantly, not in an installed module. In the second case, you define the class locally. Is that correct? If so, this may be a duplicate of #123, #128, or #56.
The Python file is in the same folder as the Jupyter notebook. There are no other modules involved. In the second case (which works) the class is in the Jupyter notebook.
Ok, thanks for the clarification. So, yes, this is a duplicate issue. dill imports the class differently if it's from __main__ versus if it's from another module. If it's from another module, it tries to import it by reference... and if the module is not installed (and thus can't be read by reference) then, it will fail. You can workaround this by artificially changing the class's module attribute to be __main__.
I'm closing this issue as duplicate. However, I think I have a fix in mind, and I'll work on this issue as part of the others listed above.
I have a Jupyter notebook with the following code:
Plus a file genclass.py in the same folder:
This results in the following error:
Interestingly, the following code works just fine:
There are some issues with similar error messages, but at least the ones I have seen are all fixed. So this is most likely something else.
Versions:
The text was updated successfully, but these errors were encountered: