Hi there,
I am trying to run a basic python program after installing pyGMT. It has been a rough journey as install is very cumbersome and lots of issues with missing libraries and need for manually identifying location of libraries. The problem do not stop there.
I am running following code and am getting error message. Can somebody help in this regards? Thanks in advance.
import os
os.system('GMT_LIBRARY_PATH=/opt/conda/envs/pygmt/lib')
import pygmt
fig = pygmt.Figure()
fig.basemap(region=["-90.00", "-70.00", "0.00", "20.00"], projection="M8i", frame=True)
fig.coast(shorelines=True)
fig.show()
fig.savefig('123.png')
I also tried using regions as [-90,-70,0,20] and error is still there.
Error Message:
psconvert [ERROR]: Cannot execute Ghostscript (gs).
Traceback (most recent call last): File "pygmtTest.py", line 8, in <module>
fig.show()
File "/opt/conda/lib/python3.8/site-packages/pygmt/figure.py", line 280, in show
png = self._preview( File "/opt/conda/lib/python3.8/site-packages/pygmt/figure.py", line 353, in _preview
self.savefig(fname, dpi=dpi, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pygmt/figure.py", line 234, in savefig
self.psconvert(prefix=prefix, fmt=fmt, crop=crop, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pygmt/helpers/decorators.py", line 270, in new_module
return module_func(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pygmt/helpers/decorators.py", line 411, in new_module
return module_func(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pygmt/figure.py", line 174, in psconvert
lib.call_module("psconvert", build_arg_string(kwargs))
File "/opt/conda/lib/python3.8/site-packages/pygmt/clib/session.py", line 506, in call_module
raise GMTCLibError(
pygmt.exceptions.GMTCLibError: Module 'psconvert' failed with status code 78:
psconvert [ERROR]: Cannot execute Ghostscript (gs).
SA