# pygmt.exceptions.GMTCLibNotFoundError: Error loading GMT shared library at 'gmt.dll'

**URL:** <https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051>\
**Category:** Q&A\
**Tags:** gmt\
**Created:** [July 6, 2024, 9:22am UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051 "2024-07-06T09:22:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kjz1997](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kjz1997/32/3874_2.png) [@kjz1997](https://forum.generic-mapping-tools.org/u/kjz1997)\
**Post date:** [July 6, 2024, 9:22am UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/1 "2024-07-06T09:22:14Z")

</div>

```auto
import pygmt

# Load sample earth relief data
grid = pygmt.datasets.load_earth_relief(resolution="10m", region=[109, 117.4, 20, 25.6])
fig = pygmt.Figure()
fig.grdview(
    grid=grid,
    # Set the azimuth to -130 (230) degrees and the elevation to 30 degrees
    perspective=[-130, 30],
    frame=["xaf", "yaf", "WSnE"],
    projection="M15c",
    zsize="1.5c",
    surftype="s",
    cmap="geo",
    plane="1000+ggrey",
    # Set the contour pen thickness to "0.1p"
    contourpen="0.1p",
)
fig.colorbar(perspective=True, frame=["a500", "x+lElevation", "y+lm"])
fig.show()

```

it reports the following errors：

Traceback (most recent call last):  
File “d:\python\PyFile\gmt\temp.py”, line 1, in   
import pygmt  
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\__init_\_.py”, line 29, in   
with clib.Session() as lib:  
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\session.py”, line 217, in **enter**  
self.create(“pygmt-session”)  
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\session.py”, line 364, in create  
c\_create\_session = self.get\_libgmt\_func(  
^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\session.py”, line 316, in get\_libgmt\_func  
self.\_libgmt = load\_libgmt()  
^^^^^^^^^^^^^  
File “C:\Users\kjzha.conda\envs\pygmt\Lib\site-packages\pygmt\clib\loading.py”, line 59, in load\_libgmt  
raise GMTCLibNotFoundError(“\n”.join(error\_msg))  
pygmt.exceptions.GMTCLibNotFoundError: Error loading GMT shared library at ‘gmt.dll’.  
Could not find module ‘gmt.dll’ (or one of its dependencies). Try using the full path with constructor syntax.  
Error loading GMT shared library at ‘gmt\_w64.dll’.  
Could not find module ‘gmt\_w64.dll’ (or one of its dependencies). Try using the full path with constructor syntax.  
Error loading GMT shared library at ‘gmt\_w32.dll’.  
Could not find module ‘gmt\_w32.dll’ (or one of its dependencies). Try using the full path with constructor syntax.

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [July 6, 2024, 10:49am UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/2 "2024-07-06T10:49:16Z")

</div>

Hello @kjz1997,

your issue looks like the problem described at [Installing — PyGMT](https://www.pygmt.org/latest/install.html#error-loading-gmt-shared-library-at). Please try to follow these instructions to fix it; let us know if it is still not working.

---

<div class="post-metadata">

**Author:** ![kjz1997](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kjz1997/32/3874_2.png) [@kjz1997](https://forum.generic-mapping-tools.org/u/kjz1997)\
**Post date:** [July 6, 2024, 12:00pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/3 "2024-07-06T12:00:59Z")

</div>

![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/7b92a5a34fece536e107e6f833f83786b2518f9a.png)  
 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/7519e5f4adfd55692c925a00550f3e567042972f.png)  
thanks for your replay, but the error still exists

---

<div class="post-metadata">

**Author:** ![auliakhalqillah](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/auliakhalqillah/32/4720_2.png) [@auliakhalqillah](https://forum.generic-mapping-tools.org/u/auliakhalqillah)\
**Post date:** [February 11, 2025, 9:56am UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/4 "2025-02-11T09:56:15Z")

</div>

Hi. I have the same problem as this one. Does any one of you solve this problem on Windows? I have followed the instructions from [PyGMT page](https://www.pygmt.org/latest/install.html#error-loading-gmt-shared-library-at), but it still does not work properly.

I appreciate any response.

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/4/4991b5948651a4b2b67d922dc076cc712411401f.png)

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [February 11, 2025, 10:28am UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/5 "2025-02-11T10:28:38Z")

</div>

Your output is truncated. Please post the full output if possible.

---

<div class="post-metadata">

**Author:** ![auliakhalqillah](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/auliakhalqillah/32/4720_2.png) [@auliakhalqillah](https://forum.generic-mapping-tools.org/u/auliakhalqillah)\
**Post date:** [February 11, 2025, 10:40am UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/6 "2025-02-11T10:40:25Z")

</div>

My apologies. Here is the full capture of the error and environment setup.

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/5/52f49703efdaaae3359e98abab432e6eea4c60a3.png)

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/bbf42b6605a8021f6a93802f69d756ec88181a84.png)

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [February 13, 2025, 3:16am UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/7 "2025-02-13T03:16:05Z")

</div>

![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/optimized/2X/5/56f98a3c385299f90e89317ed2c482398276aac4_2_690x32.png)

It’s still truncated. Click the “text editor” link in the screenshot above, then you should be able to see the full output.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [February 13, 2025, 2:22pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-exceptions-gmtclibnotfounderror-error-loading-gmt-shared-library-at-gmt-dll/5051/8 "2025-02-13T14:22:44Z")

</div>

Dongdong, that is the same error I see when trying to launch pygmt from the root dir of the git checkout.  
We (me and Weiji) briefly tried to fix at the AGU but no success. The error makes of some dependency not-found/conflict of some kind. But the strange thing is that `c:\programs\GMTDIR\gmt_w64.dll` is the exact same dll that the Julia wrapper uses in my developing machine, and no dependency is missing.

```auto
>>> import pygmt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\progs_cygw\GMTdev\gmt5\pygmt\pygmt\ __init__.py", line 24, in <module>
    from pygmt import datasets
  File "C:\progs_cygw\GMTdev\gmt5\pygmt\pygmt\datasets\ __init__.py", line 7, in <module>
    from pygmt.datasets.earth_age import load_earth_age
  File "C:\progs_cygw\GMTdev\gmt5\pygmt\pygmt\datasets\earth_age.py", line 12, in <module>
    from pygmt.datasets.load_remote_dataset import _load_remote_dataset
  File "C:\progs_cygw\GMTdev\gmt5\pygmt\pygmt\datasets\load_remote_dataset.py", line 9, in <module>
    from pygmt.clib import Session
  File "C:\progs_cygw\GMTdev\gmt5\pygmt\pygmt\clib\ __init__.py", line 9, in <module>
    from pygmt.clib.session import Session, __gmt_version__
  File "C:\progs_cygw\GMTdev\gmt5\pygmt\pygmt\clib\session.py", line 110, in <module>
    _libgmt = load_libgmt()
              ^^^^^^^^^^^^^
  File "C:\progs_cygw\GMTdev\gmt5\pygmt\pygmt\clib\loading.py", line 62, in load_libgmt
    raise GMTCLibNotFoundError("\n".join(error_msg))
pygmt.exceptions.GMTCLibNotFoundError: Error loading GMT shared library at 'c:\programs\GMTDIR\gmt_w64.dll'.
Could not find module 'c:\programs\GMTDIR\gmt_w64.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Error loading GMT shared library at 'gmt.dll'.
Could not find module 'gmt.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Error loading GMT shared library at 'gmt_w64.dll'.
Could not find module 'gmt_w64.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Error loading GMT shared library at 'gmt_w32.dll'.
Could not find module 'gmt_w32.dll' (or one of its dependencies). Try using the full path with constructor syntax.

```
