I’m unsuccessfully trying to import pygmt on a Jupyter Notebook on macOS Monterey 12.5.
However, pygmt works if I launch python through my terminal and I get the following:
`~ python
Python 3.9.10 (main, Aug 23 2022, 09:58:58)
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
Most of my python modules were installed within pyenv, but homebrew installs GMT in a different location. I’ve tried to remove and reinstall GMT with homebrew but it gets installed in the same place by default. Would you have any tips on how to fix this?
I’ve included the following env variable to my .zshrc but it’s not helping:
#Path to GMT shared lib
export GMT_LIBRARY_PATH="/opt/homebrew/Cellar/gmt/6.4.0_1/lib"
I’ve tried this on Jupyter but it also doesn’t help
I copied some of the /opt/homebrew/Cellar/gmt/6.4.0_1 info into the /Users/roberta/.pyenv/versions/3.9.10/lib/python3.9/site-packages/ and updated my env variable to:
You did not mention how you installed the Jupyter software. It is not easy to get different Python installations to work together, especially when using Jupyter. I found it is easier to install everything for PyGMT using Anaconda including a version of GMT, even though I have a separate GMT that I use from the command line. This way all the components are in the came “conda” environment.
I’ve updated my OS, and uninstalled and reinstalled Brew and Xcode. I’ve installed python without pyenv, so I’ve everything installed with brew. As from below: