Cannot execute Ghostscript in vscode(windows)

When I input the example of pygmt in cmd, it can be executed correctly and drawn, and the version number of ghostscript can be displayed. However, when I execute the same statement in vscode, an error will be reported and the ghostscript version number will not be displayed