-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot pickle sympy.polys.domains.mpelements.constant #186
Comments
I see you are using 3.5. Since it's the same error, I'm going to assume this is a duplicate of #132. It would help if you supplied minimal test code so we can reproduce your error. If you don't I'll close this, assuming it's a duplicate. |
Thanks for replying!
|
So, when I isolate all of the objects in
The above shows there is likely only one serialization error as the root cause… and to get some more info, we turn on
We can see that I'm getting essentially the same error as you are, and it comes from Note that if I try this in python
Maybe this is a |
The objects in that module subclass from mpmath objects. My guess is that the issue lies there. Another question: do you have gmpy or gmpy2 installed? mpmath uses those if they are installed for internal some representations and it could muddle things. |
@asmeurer: I didn't have It could be resolved by adding a method to the class that informs the class how to be serialized. I'm going to check if the issue still occurs for some of the pickling variants in |
Here's
In this case, we have failure with the same error, the same way... and additionally it can't serialize the |
Also, using the |
Oh it's related to cacheit? In that case, do you or do you not have |
@asmeurer: the error that was initially reported for this ticket is not related to As per your question, no, I don't have |
OK, that's not surprising. SymPy has lots of pickling issues, even with dill and cloudpickle. Also be sure to test SymPy master (we already have at least one pickling related fix that I know of). |
Going back to the original issue, here is the class in question. Would |
@asmeurer: I don't think that's the issue. See below:
Almost all This was probably done to generalize the |
Oh I just noticed a few lines down some dynamic classes are being created with |
@asmeurer: right… so if I think the fix for this should be in |
Yes (or a PR😉) |
Looks like this now works for python 3.x, but not 2.7. |
no longer relevant |
This happens when I try to import sympy and save the locals in a file.
_pickle.PicklingError: Can't pickle <class 'sympy.polys.domains.mpelements.RealElement'>: it's not the same object as sympy.polys.domains.mpelements.RealElement
Any ideas why that happens/how to fix?
Obs: Quite similar to #182
Full traceback:
The text was updated successfully, but these errors were encountered: