No module named pygmt in Spyder

Ok, in Spyder on your bottom right, notice the “conda: base (Python 3.7.6)”? I’m not sure if you can click on it, but you’ll probably need to find a way to change it to “conda: pygmt (Python 3.8.X)”. This will make sure you’re using the 'pygmt' conda environment instead of the regular 'base' one.

In Jupyter notebook, you can click on Kernel-> Change Kernel -> pygmt to change the python kernel being used:

Note that I’m assuming you’ve followed the instructions at Installing — PyGMT to install gmt and pygmt into a python virtual environment called “pygmt” (Let me know if this is confusing). You could also type conda env list in the terminal to see if that’s the name you used.

Also, just a heads up that running pygmt.test() might give you some errors (see https://flint.soest.hawaii.edu/t/about-pygmt-test/598), don’t worry, that’s expected for now. Let me know if that helps :smile: