# Import PyGMT in JupyterLab error

**URL:** <https://forum.generic-mapping-tools.org/t/import-pygmt-in-jupyterlab-error/2975>\
**Category:** PyGMT Q&A\
**Created:** [May 31, 2022, 1:31am UTC](https://forum.generic-mapping-tools.org/t/import-pygmt-in-jupyterlab-error/2975 "2022-05-31T01:31:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@Edgar](https://forum.generic-mapping-tools.org/u/Edgar)\
**Post date:** [May 31, 2022, 1:31am UTC](https://forum.generic-mapping-tools.org/t/import-pygmt-in-jupyterlab-error/2975/1 "2022-05-31T01:31:12Z")

</div>

Hello,

I’m new to GMT and I was trying to install PyGMT on JupyterLab when I got the following error.

```
GMTCLibNotFoundError: Error loading GMT shared library at 'libgmt.so'.
libgmt.so: cannot open shared object file: No such file or directory

```

I have looked at the install guide and the various posts on the forum where others have encountered the same issue but none of the solutions seemed to have worked for me. May I get some help with this?

---

<div class="post-metadata">

**Author:** ![weiji14](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/weiji14/32/33_2.png) [@weiji14](https://forum.generic-mapping-tools.org/u/weiji14)\
**Post date:** [May 31, 2022, 2:15pm UTC](https://forum.generic-mapping-tools.org/t/import-pygmt-in-jupyterlab-error/2975/2 "2022-05-31T14:15:11Z")

</div>

Hello @Edgar, could you briefly describe the way you installed PyGMT and GMT (the C library)? The error message you posted indicates that PyGMT is having trouble finding the GMT C library, so you would either need to provide the correct path following [https://www.pygmt.org/v0.6.1/install.html#finding-the-gmt-shared-library](https://www.pygmt.org/v0.6.1/install.html#finding-the-gmt-shared-library), or more usually, it would be a matter of activating the Python virtual environment correctly.

If you let us know which Operating system (Windows/macOS/Linux) and package manager you are using (e.g. `conda`, `apt-get`, `brew`, etc), it’ll be easier for us to advise on what to do.

---

<div class="post-metadata">

**Author:** ![Edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@Edgar](https://forum.generic-mapping-tools.org/u/Edgar)\
**Post date:** [May 31, 2022, 2:55pm UTC](https://forum.generic-mapping-tools.org/t/import-pygmt-in-jupyterlab-error/2975/3 "2022-05-31T14:55:19Z")

</div>

Hi Wei Ji,

I am using Windows and I installed the 64 bit standalone installers from the repository and I followed the conda install method from the install guide. Weirdly enough, I managed to install and import PyGMT locally on Anaconda and worked there instead so I somewhat avoided the JupyterLab problem.

---

<div class="post-metadata">

**Author:** ![weiji14](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/weiji14/32/33_2.png) [@weiji14](https://forum.generic-mapping-tools.org/u/weiji14)\
**Post date:** [May 31, 2022, 2:59pm UTC](https://forum.generic-mapping-tools.org/t/import-pygmt-in-jupyterlab-error/2975/4 "2022-05-31T14:59:56Z")

</div>

Hmm I see, maybe double-check that you have set `jupyter` to use the `pygmt` kernel? See my answer at [https://flint.soest.hawaii.edu/t/no-module-named-pygmt-in-spyder/702/3](https://flint.soest.hawaii.edu/t/no-module-named-pygmt-in-spyder/702/3). There should be a place on the top-right corner where you can select the kernel.

 ![Change kernel in Jupyter Lab](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/6/6a8fa89b771b6b17e1ee62d84a11a1995e30294a.png)
