1

I get this error every time I type:

from matplotlib.pyplot import close, figure, plot, axis, grid

The error reads:

double free or corruption (top)

What does this mean? How might I address it? This happens even if it is the first thing I type, with no previous commands.

  • 1
    Does this answer your question? [Python double free error for huge datasets](https://stackoverflow.com/questions/14906962/python-double-free-error-for-huge-datasets) – Red Nov 07 '20 at 02:48
  • I don't think so, unless I'm very much misunderstanding it. What I'm trying to do does not involve a data set at all, whereas the person there is having the issue with large data sets but not smaller ones. – Brittany May Nov 07 '20 at 03:06
  • Okay, got it! - – Red Nov 07 '20 at 03:07

2 Answers2

1

It sounds like a C-level problem, something with the (malloc) heap.

I'd try a newer CPython (up to but not including 3.9), or try removing matplotlib and reinstalling it with your current version of CPython.

BTW, I tried your import with CPython 3.8, and did not get the quoted error; it seemed to import fine. I did this with a freshly-installed matplotlib.

dstromberg
  • 6,954
  • 1
  • 26
  • 27
-1

To anyone facing this issue . One of the likely reason for this error is beacuse in your batch script you havent mentioned the ppn .I am not sure how it causes the error but it has do with memory .

vinod7798
  • 1
  • 1
  • What is "the ppn", and why does it need to be mentioned in the script? What do you mean by "mention"? – ChrisGPT was on strike May 09 '23 at 13:59
  • 2
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 09 '23 at 13:59
  • ppn=processor per node .When I say mention I meant say you have a job script where you have to write the number of nodes and ppn you would be needing for your code . So when I just mentioned the nodes I would be needing and passed an argument say -n 18 to mpiexec I got this double free corruption error which went away when I specifically mentioned the ppn I would be using – vinod7798 May 10 '23 at 14:10