Can't import pygmt after installing GMT from Mac package


I’ve installed GMT using the most recent Mac package (gmt-6.2.0-darwin-x86_64.dmg) and tested that it works. I then installed pygmt via pip. However, “import pygmt” from the Python command line produces the following:

import pygmt
Traceback (most recent call last):
File “”, line 1, in
File “/opt/anaconda3/lib/python3.8/site-packages/pygmt/”, line 57, in
File “/opt/anaconda3/lib/python3.8/site-packages/pygmt/”, line 16, in begin
with Session() as lib:
File “/opt/anaconda3/lib/python3.8/site-packages/pygmt/clib/”, line 185, in enter
File “/opt/anaconda3/lib/python3.8/site-packages/pygmt/clib/”, line 332, in create
c_create_session = self.get_libgmt_func(
File “/opt/anaconda3/lib/python3.8/site-packages/pygmt/clib/”, line 284, in get_libgmt_func
self._libgmt = load_libgmt()
File “/opt/anaconda3/lib/python3.8/site-packages/pygmt/clib/”, line 59, in load_libgmt
raise GMTCLibNotFoundError(“\n”.join(error_msg))
pygmt.exceptions.GMTCLibNotFoundError: Error loading GMT shared library at ‘/Applications/’.
dlopen(/Applications/, 6): Library not loaded: @executable_path/…/lib/libcurl.4.dylib
Referenced from: /Applications/
Reason: Incompatible library version: libgmt.dylib requires version 12.0.0 or later, but libcurl.4.dylib provides version 11.0.0
Error loading GMT shared library at ‘libgmt.dylib’.
dlopen(libgmt.dylib, 6): image not found

This is made even more confusing when I check on libcurl.4.dylib:

otool -L libcurl.4.dylib
@executable_path/…/lib/libcurl.4.dylib (compatibility version 12.0.0, current version 12.0.0)

In case it matters, I’m on Big Sur 11.6.

Any suggestion would be awesome.


I’m just new at GMT, but I have both GMT and PyGMT running on MacOS 11.6. I installed the GMT dmg. But I also just independently installed the PyGMT and GMT python modules from conda-forge as per:

Yes, it’s a known issue that the macOS bundle doesn’t work for GMT wrappers like PyGMT, GMT.jl or GMT/Matlab.

macOS bundle doesn’t work for pygmt · Issue #1930 · GenericMappingTools/gmt (

Thanks, this is what I did on my Mac and a remote Linux machine, and it was successful.