ecmwf / climetlab

Python package for easy access to weather and climate data
Apache License 2.0
374 stars 58 forks source link

Magics library cound not be found #12

Closed yuyf-fsd closed 3 years ago

yuyf-fsd commented 3 years ago

image

after installing climetlab with version 0.2.3, I tried to run demos, but can not get expected result.

`import climetlab as cml

data = cml.load_source( "url", "https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r00/access/csv/ibtracs.SP.list.v04r00.csv", )

pd = data.to_pandas() uma = pd[pd.NAME == "UMA:VELI"] cml.plot_map(uma, style="cyclone-track")`

floriankrb commented 3 years ago

Hello, thank you for you interest for climetlab, it seems climetlab was not correctly installed in your virtual env.

Are you using pip ? conda ? Which version of python ? which platform ? 'pip install climetlab' on a clean environment does work nicely (as you see, the example runs ok here : https://deepnote.com/project/83ffd75c-a3ef-4b99-a5dc-0b8503c25ba8) but you must have some other packages causing compatibility issues.

Posting the output of "pip freeze" (and "conda list" if relevant) could be interesting to trace the root cause of your issue.

yuyf-fsd commented 3 years ago

Thank you for your reply.

virtual env was created with Python 3.7.9, using pip 21.0.1 on Mac OS

while installing with 'pip install climetlab', climetlab==0.0.9 was installed instead of latest 0.2.3 (by checking requirements.txt), so I installed with 'pip install climetlab==0.2.3'. Please see below the 'pip freeze' list.

--> aiobotocore==1.2.1 aiohttp==3.7.2 aioitertools==0.7.1 asciitree==0.3.3 async-timeout==3.0.1 attrs==20.3.0 botocore==1.19.52 cdsapi==0.5.1 certifi==2020.12.5 cffi==1.14.5 cfgrib==0.9.8.5 cftime==1.4.1 chardet==3.0.4 click==7.1.2 climetlab==0.2.3 Cython==0.29.22 dask==2021.3.0 eccodes==1.1.0 ecmwf-api-client==1.6.1 ecmwflibs @ file:///Users/bayes/dpa/meteo-climetlab/ecmwflibs-0.0.94-cp37-none-any.whl entrypoints==0.3 fasteners==0.16 fsspec==0.8.7 idna==2.10 importlib-metadata==3.7.2 jmespath==0.10.0 Magics==1.5.5 Markdown==3.3.4 multidict==5.1.0 netCDF4==1.5.6 numcodecs==0.7.3 numpy==1.20.1 pandas==1.2.3 pdbufr==0.8.2 pycparser==2.20 pyodc==1.0.3 python-dateutil==2.8.1 pytz==2021.1 PyYAML==5.4.1 requests==2.25.1 s3fs==0.5.2 six==1.15.0 toolz==0.11.1 tqdm==4.59.0 typing-extensions==3.7.4.3 urllib3==1.26.3 wrapt==1.12.1 xarray==0.17.0 yarl==1.6.3 zarr==2.6.1 zipp==3.4.1 <--

yuyf-fsd commented 3 years ago

I have Tried to re-create virtual env,and installed climetlab with verion 0.3.4,the same problems persist.

image

floriankrb commented 3 years ago

From what I see, climetlab itself is installed correctly, the issue is with the python package Magics.

My guess is that Magics has trouble importing the (non-python) libraries that it needs. The package ecmwflibs does provide some of these libraries, but these libraries may have dependencies that are not installed in your system. Could you show the output of import Magics and import ecmwflibs ?

yuyf-fsd commented 3 years ago

That seems to be the point, import ecmwflibs has no error, but import ecmwflibs print error as below:

ad

I removed the virtual environment and reinstalled latest climetlab with version 0.5.0, import Magics error is still exist. while testing import climetlab as cml, another error arises:

2
floriankrb commented 3 years ago

This exact ModuleNotFoundError error was there in climetlab version 0.5.0. Could you update to climetlab version 0.5.4 (it was uploaded to pipy yesterday) ?

kserradell commented 3 years ago

Hello. I was having the same issue and I confirm 0.5.3 solve it. I have been able to deploy climetlab in a Power9 machine using EasyBuild.

Great work!