pydap / pydap

A Python library implementing the Data Access Protocol (DAP, aka OPeNDAP).
https://pydap.github.io/pydap/
MIT License
138 stars 87 forks source link

Following the README instructions led to a failure on import #371

Open tennlee opened 2 weeks ago

tennlee commented 2 weeks ago

I installed pydap and ran the following:

import pydap
from pydap.client import open_url

This led to the following error:

lib/python3.12/site-packages/pydap/responses/lib.py#line=20), in load_responses()
     19 def load_responses():
     20     """Load all available responses from the system, returning a dictionary."""
---> 21     eps = entry_points(group="pydap.response")
     22     Rs = [r for r in eps if r.module[:5] == "pydap"]
     23     nRs = [r for r in eps if r.module[:5] != "pydap"]

TypeError: entry_points() got an unexpected keyword argument 'group'

I'm happy to help debug this but thought I would report it.

tennlee commented 2 weeks ago

These failures went away when I downgraded to numpy 1.26 and Python 3.10. I haven't dug further to discover the exact root cause but I suspect something in the dependency chain has recently introduced the issue.

Mikejmnez commented 2 weeks ago

Thanks @tennlee for reaching out! You are right, the issue is with the numpy dependency. numpy was pinned to version <2 up to last week I believe, but in the latest commit we introduced some change to have numpy>=2 as a requirement. Can you try in your environment installing the latest commit of pydap?

python -m pip uninstall pydap # optional but sometimes things linger...
pip install --upgrade git+https://github.com/pydap/pydap.git

I am planning a new version release asap (after some pushes I make today), that will have all these new features pip/conda installable.

Mikejmnez commented 1 week ago

@tennlee could you share the environment where you ran into these issues? I would like to replicate the error. I think I remember seeing this error back when we set the implicit discovery of entry_points. I no longer remember what the issue with that, but it got around it.

Also - since pydap 3.5 released last Aug and available via pip and conda installs, pydap is only compatible with numpy>=2.0. And so the fact that pydap is even running in your system with numpy 1.26 probably means something went wrong during the initial installation...

Thanks again!

tennlee commented 3 days ago

I tried this again and it didn't reproduce. That was a bit of a surprise because I hadn't done anything out of the ordinary. I will try again in the next couple of days, but perhaps this one isn't a big problem. It could be some quirk of the dependency resolution which just doesn't apply any more.

Mikejmnez commented 2 days ago

That is good news! Thanks for checking back and do let us know if this is a problem later.