Hi @sherfy, thanks for reporting the issue. Could you provide the output of:
import pygmt
pygmt.show_versions()
Just want to see what version of GMT/PyGMT you have installed.
Is this error happening on reload(pygmt), or another line in your Python script? If it is another function (e.g. fig.plot()), could you turn on debugging mode using e.g. fig.plot(..., verbose=True), and post the output from that? That would make it easier to know where the issue is.
The version of my PyGMT is: 6.4.0. And my full error is:
pygmt-session [ERROR]: Not available in classic mode
Module ‘figure’ failed with status code 30
I tried to add ‘verbose=True’, and here is my output:
plot [INFORMATION]: Processing input table data
plot [INFORMATION]: Central meridian not given, default to 127.95
plot [INFORMATION]: Map scale is 7.79236 km per cm or 1:779236.
plot [INFORMATION]: Reading Data Table from Input memory location via vector
double free or corruption (out)
Aborted (core dumped)
OK, now I know the reason. Since your Python script crashes, the GMT session is not correctly ended. Could you please try run gmt clear sessions again, and then run the following commands in your Python interpreter:
I use this method solved the problem:double free or corruption (out). But a new one has arisen, I will have Segmentation fault (core dumped) when I run my code.
I use this method solved the problem:double free or corruption (out). But a new one has arisen, I will have Segmentation fault (core dumped) when I run my code.
Thank you for your answers. I really appreciate you helping me with this.
The problem should be caused by the bash GMT code with os.system before running this code.
But how to close the GMT correctly? By using the “gmt clear sessions”?