I’m not very familiar with Python, only used it sporadically with obspy. Recently in one of my master’s courses we learned about GMT and did a map on a chosen area, we used the non-python version of GMT. It wasn’t until now that I found out about pyGMT and therefore wanted to test it since I’m now more familiar with Python. Unfortunately I can’t get it to run on Pycharm, although I followed all instructions. I always get the error that pygmt modul is not found, but when I list all modules, it’s there…and I activated the environment.
Furthermore, I never used Jupyter before, just tested it and started it from Pycharm and pygmt works there…
Is there something I’m missing to get it to run on Pycharm?
Hi @zersorger, welcome to the community! Could you copy and paste the error message you are getting (or a screenshot) so we can help debug this? You’ve probably had a search for other related issues already, but just in case:
I dind’t change anything but deinstalled and reinstalled pygmt and restarted. But seems like overnight it started working (although I also de- and reinstalled it several times before…)!
If you have some spare time, could you share the steps you did or some screenshots of how you set up PyCharm with PyGMT? It might be helpful to someone else using PyCharm in the future to know what settings to change in order for the code to run properly.
Hello
I am having similar problems: not able to make pyGMT work on PyCharm. I see you were missing some screenshots last time, so I am going to provide it:) I am not an expert with Python or Pycharm, so excuse trivialities…
installing, following help (Path variables | PyCharm Documentation):
Press Ctrl+Alt+S to open the IDE settings and then select Appearance & Behavior | Path Variables.
pygmt.exceptions.GMTCLibNotFoundError: Error loading GMT shared library at ‘libgmt.so’.
libgmt.so: cannot open shared object file: No such file or directory
Thanks for posting the screenshots The GMTCLibNotFoundError: Error loading GMT shared library at ‘libgmt.so’ you’re getting is likely because you have not installed the GMT C library (which is what PyGMT is wrapping around). I’d recommend you follow https://www.jetbrains.com/help/pycharm/conda-support-creating-conda-virtual-environment.html to set up a conda environment instead of a standard virtualenv (venv) if possible.