Comments (13)
Changing versions didn't work for me. All I had to do was:
pip install ecmwflibs
From bindings.py in:
File "/home/panos/venv_eccodes/lib/python3.8/site-packages/gribapi/bindings.py", line 33, in <module>
raise RuntimeError("Cannot find the ecCodes library")
There was:
try:
import ecmwflibs as findlibs
except ImportError:
import findlibs
The findlibs package was the problem.
from eccodes-python.
Before installing cfgrib,
$ pip install ecmwflibs
$ pip install eccodes==1.3.1
and then
$ pip install cfgrib
my ecmwflibs version is 0.4.3
Thanks to @CrayonAki
from eccodes-python.
What solved for me was REALLY to install ECMWFlibs, just because eccodes depends on this earlier library to work. The version of ECcodes does not matter!
So, at Google Colab, you can do:
!$ pip install ecmwflibs
!$ pip install eccodes
!$ pip install cfgrib
Found: eccodes v2.26.0
Your system is ready
from eccodes-python.
Ubuntu 20.04, python 3.8
Following @nfick, I installed ecmwflibs with pip install ecmwflibs
.
I also tried to change version, but eccodes==1.2.0 seemed not working. So I tried version eccodes==1.3.1.
I don't know which step is actually working, but finally eccodes can be imported.
from eccodes-python.
Same here. pip install eccodes==1.2.0
worked for me.
from eccodes-python.
Tried some more tests and there appears to be some sort of conflict on RHEL-based systems: Amazon Linux 2 for example puts the libraries in a lib64/ directory (which fails) while Ubuntu does lib/ (which works).
As a workaround I renamed lib64 to lib and added the lib path to LD_LIBRARY_PATH and it worked under AL2. Not idea but maybe that helps track down the root cause?
from eccodes-python.
Im getting a similar error when runner a docker file
FROM python:3.9-slim RUN apt-get -qq update \ && apt-get -qq install -y --no-install-recommends \ libproj-dev \ libgeos-dev \ && apt-get autoclean && apt-get autoremove \ > /dev/null # copy files COPY metofficeamd/ app/metofficeamd/ COPY setup.py app/setup.py COPY README.md app/README.md COPY requirements.txt app/requirements.txt # change to app folder WORKDIR /app # install library RUN pip uninstall cfgrib RUN pip install ecmwflibs RUN pip install eccodes==1.3.1 RUN pip install cfgrib RUN pip install -e . # Example commnad that can be used, need to set API_KEY, API_SECRET and SAVE_DIR CMD ["python", "metofficeamd/app.py"]
by adding 'libeccodes-tools' it now seems to work
from eccodes-python.
Can confirm what the above posters found as well, works with 1.2.0 but fails with anything 1.3.x
Using Python3.8 w/ ecCodes 2.22.0
from eccodes-python.
Hi @pmav99 @Xunius I just did a fresh install of ecCodes 2.22.1 and eccodes-python 1.3.3 on Ubuntu 20.04 and the import worked fine. I saw v1.3.3 was released since we noticed this error maybe it was fixed in that version?
from eccodes-python.
Tried some more tests and there appears to be some sort of conflict on RHEL-based systems: Amazon Linux 2 for example puts the libraries in a lib64/ directory (which fails) while Ubuntu does lib/ (which works).
As a workaround I renamed lib64 to lib and added the lib path to LD_LIBRARY_PATH and it worked under AL2. Not idea but maybe that helps track down the root cause?
Thanks! Updating the LD_LIBRARY_PATH is the only thing that worked for me (cluster on Cent OS)
from eccodes-python.
@nfick's fix works for me on Linux, but on Windows it causes some strange DLL load warnings:
C:\Users\peteb\miniconda3\envs\wedev\lib\site-packages\ecmwflibs\__init__.py:75:
UserWarning: DLL load failed while importing _ecmwflibs: The specified procedur
e could not be found.
warnings.warn(str(e))
C:\Users\peteb\miniconda3\envs\wedev\lib\site-packages\xarray\backends\cfgrib_.p
y:27: UserWarning: Failed to load cfgrib - most likely there is a problem access
ing the ecCodes library. Try `import cfgrib` to get the full error message
warnings.warn(
But import eccodes
works without error.
from eccodes-python.
Im getting a similar error when runner a docker file
FROM python:3.9-slim
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends \
libproj-dev \
libgeos-dev \
&& apt-get autoclean && apt-get autoremove \
> /dev/null
# copy files
COPY metofficeamd/ app/metofficeamd/
COPY setup.py app/setup.py
COPY README.md app/README.md
COPY requirements.txt app/requirements.txt
# change to app folder
WORKDIR /app
# install library
RUN pip uninstall cfgrib
RUN pip install ecmwflibs
RUN pip install eccodes==1.3.1
RUN pip install cfgrib
RUN pip install -e .
# Example commnad that can be used, need to set API_KEY, API_SECRET and SAVE_DIR
CMD ["python", "metofficeamd/app.py"]
from eccodes-python.
I'm working with someone who is trying to add cfgrib/eccodes to our build environment and is running into weird behavior. Sometimes they get the same error(s) mentioned here and other times the errors are slightly different and sometimes it works. Whether the environment works or errors out seems to be related to the order the packages are installed.
The order the packages are installed shouldn't matter, right? There should be no reason you can't do pip install ecmwflibs eccodes cfgrib
since all the usage happens at runtime not install time...right?
Note: Some of the issues we're running into may be specific to us trying to use pyinstaller to bundle our environment into a distributed application.
from eccodes-python.
Related Issues (20)
- Unexpected behavior if not all GRIB messages in a file are read HOT 1
- data file tiggelam_cnmc_sfc.grib2 not included in released tar file eccodes-1.4.0.tar.gz HOT 7
- Can eccodes decode buffr radar image? HOT 6
- When the package ecmwflibs is available, ECCODES_DEFINITION_PATH is removed after `from gribapi import *` HOT 13
- open up discussion tab on github?
- Please use the warnings library for selfcheck HOT 6
- failing tests due to missing sample file. HOT 1
- read data from bytes object HOT 2
- Reading NCEP BUFR with Local Tables HOT 2
- Please support Python 3.10 (and 3.11) HOT 2
- Add support for `GRIB_TYPE_BYTES` to `codes_get_native_type` and `codes_get_array` HOT 4
- `codes_get` silently returns `None` for unsupported key types HOT 3
- Please support Python 3.11 HOT 1
- Latitude/longitude grid inconsistent behavior between GRIB1 and GRIB2 HOT 5
- Add method to access the result of the json bufr_dump HOT 5
- Update min_recommended_version for eccodes HOT 3
- Enabling thread safety using pip HOT 2
- aarch64 supports HOT 4
- 1.7.0: build fails with gcc error HOT 3
- Doesn't install on ubuntu HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eccodes-python.