pygrib ImportError: symbol not found in flat namespace '_grib_context_set_definitions_path'

43 Views Asked by At

I'm encountering an issue with the pygrib library in Python. When I try to import and use pygrib, I receive the following error:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pygrib/_pygrib.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_grib_context_set_definitions_path'

Environment Details:

Python Version: 3.11 Operating System: MacOS Ventura (13.5.1) Installation Method: pip

Steps to Reproduce:

Installed pygrib using pip install pygrib. Ran a simple script to import pygrib (see below).

import pygrib

grbs = pygrib.open('2m_temperature.grib')

for grb in grbs:
    print(grb)
    exit()

What I've Tried:

Reinstalled pygrib. Checked for multiple Python installations and ensured I'm using Python 3.11. Created a new virtual environment with Python 3.11 and installed pygrib within it. pip uninstall pygrib (and install again) Compiled pygrib from source (although I'm not sure I did right). Searched for similar issues but couldn't find a solution that works for my case.

Does anyone have any insights or suggestions on how to resolve this issue? Any help would be greatly appreciated!

0

There are 0 best solutions below