I just upgraded my MacPorts to Mac OS Sierra and expected some problems. First I followed the instructions on migrating. Then I uninstalled all ports and started installing the ones I needed as I went along. The ECMWF’s GRIB-API package is one of them.
When installing through MacPorts, and if you need Python bindings, you must run:
sudo port install grib_api +python27
Otherwise, you won’t be able to do this:
from gribapi import *
But I still had a problem, as I got the following error message:
ImportError: No module named _gribapi_swig
Aha, I though, because I remembered that I had to hack this. What it needs is a .so file, a shared object. Ok, so I went into the directory that holds the Python bindings files. In my case that was:
Now I just needed to create a symbolic link:
sudo ln -s _gribapi_swig.dylib _gribapi_swig.so
And everything was good to go.