Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync internal ecCodes bindings to eccodes-python #81

Closed
alexamici opened this issue May 14, 2019 · 2 comments
Closed

Sync internal ecCodes bindings to eccodes-python #81

alexamici opened this issue May 14, 2019 · 2 comments

Comments

@alexamici
Copy link
Contributor

This has been done to get ready to depend on the external binding in https://github.com/ecmwf/eccodes-python

Most of the work has been to move the API from bytes to str.

Versions 0.9.6.x will stay on the old internal API only. Starting form version 0.9.7 cfgrib can use the external bindings if installed.

@alexamici
Copy link
Contributor Author

Done in branch stable/0.9.7.x

@datarods-svc
Copy link

@alexamici If this is so, then why does python -m cfgrib selfcheck fail? Due to this, I'm effectively still forced to use conda. Thanks.

Log:

(venv) (ingest-grib) AB-MacBook-Pro:ingest-grib ab$ python -V
Python 3.7.4

(venv) (ingest-grib) AB-MacBook-Pro:ingest-grib ab$ pip list
Package        Version
-------------- -------
attrs          19.1.0 
cffi           1.12.3 
cfgrib         0.9.7.1
Click          7.0    
eccodes-python 0.9.2  
numpy          1.17.0 
pip            19.2.2 
pycparser      2.19   
setuptools     40.8.0 

(venv) (ingest-grib) AB-MacBook-Pro:ingest-grib ab$ python -m cfgrib selfcheck
Traceback (most recent call last):
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cfgrib/bindings.py", line 48, in <module>
    lib = ffi.dlopen(libname)
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cffi/api.py", line 146, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cffi/api.py", line 828, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cffi/api.py", line 823, in _load_backend_lib
    raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library called 'libeccodes'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cfgrib/__init__.py", line 19, in <module>
    from .cfmessage import CfMessage
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cfgrib/cfmessage.py", line 28, in <module>
    from . import messages
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cfgrib/messages.py", line 36, in <module>
    from . import bindings as eccodes
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cfgrib/bindings.py", line 86, in <module>
    CODES_TYPE_UNDEFINED = lib.GRIB_TYPE_UNDEFINED
  File "/Users/ab/PycharmProjects/ingest-grib/venv/lib/python3.7/site-packages/cfgrib/bindings.py", line 43, in __getattr__
    raise RuntimeError(self.message) from self.exc
RuntimeError: ecCodes library not found on the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants