No Module named "pgymt"


PyGMT was highly recommended to me by a coworker and I wanted to install it on my laptop (MacOS, M1 chip). I followed the step-by-step instructions on but so far, I have only encountered the 'ModuleNotFoundError', indicating that there is no module named pygmt.
I use Anaconda The Python version of my environment is 3.9.12. When I type conda list or my environment pygmt-env it says I have pygmt 0.6.1 and gmt 6.3.0 installed. I have set up the path to the module using export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/pygmt_env/lib

I’ve removed an recreated my pygmt environment multiple times by now, each time following the steps outlined in the instructions and every time I get the same result: pygmt and gmt apparently installed, no module found. I’ve looked on around on the internet how to solve this problem but either I’ve tried it and it doesn’t work or I simply don’t understand what they mean. The weird thing is that I encountered the same problem on my previous laptop (Windows). I was wondering if there is someone here that could help me figure out what is the problem.

Many thanks!!

Hi @thomas.schouten, thanks for trying PyGMT! Can I ask where you’re trying to use PyGMT from? Is it from a Jupyter notebook or an IDE like PyCharm/VS Code? Depending on where you’d like to run PyGMT, the instructions would vary, but these are some links that might help:

My guess is that you’ll need to ensure that you’re running your code using the ‘pygmt’ kernel instead of the default Anaconda/Python kernel. If you could provide some error messages and/or screenshots, that will help us to debug the situation.

Hi weiji14,

Thanks for your answer and sorry for my late response!
In the end, a colleague helped me out and we found out that the problem was I was unable to run the correct kernel in Jupyter Notebook. Using VSCode however, we were able to solve the problem :smiley:

Thanks a lot!


1 Like