No module named 'numpy.lib.arrayterator'

30 views
Skip to first unread message

Jim Fluke

unread,
Jul 2, 2024, 1:45:29 PMJul 2
to pydap
Hello,

I have been seeing this error message recently - just for the last two weeks. Here is the code:

import os
from pydap.client import open_url

When I try to run this, I get:
Traceback (most recent call last):
 File "/app/opendap_pydap.py", line 2, in <module>
   from pydap.client import open_url
 File "/opt/conda/lib/python3.12/site-packages/pydap/client.py", line 53, in <module>
   from .handlers.dap import DAPHandler, unpack_data, StreamReader
 File "/opt/conda/lib/python3.12/site-packages/pydap/handlers/dap.py", line 32, in <module>
   from .lib import ConstraintExpression, BaseHandler, IterData
 File "/opt/conda/lib/python3.12/site-packages/pydap/handlers/lib.py", line 21, in <module>
   from numpy.lib.arrayterator import Arrayterator
ModuleNotFoundError: No module named 'numpy.lib.arrayterator'

It seems like the import statement in lib.py ought to be:
from numpy.lib import Arrayterator

Any help would be greatly appreciated.

Thanks,
Jim

Chris Barker

unread,
Jul 2, 2024, 3:54:56 PMJul 2
to py...@googlegroups.com
On Tue, Jul 2, 2024 at 10:45 AM Jim Fluke <james...@colostate.edu> wrote:
I have been seeing this error message recently - just for the last two weeks. 
When I try to run this, I get:
   from numpy.lib.arrayterator import Arrayterator
ModuleNotFoundError: No module named 'numpy.lib.arrayterator'

It seems like the import statement in lib.py ought to be:
from numpy.lib import Arrayterator

I think so, yes -- looks like that may have changed in numpy 2.0:

https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#numpy-lib-namespace

you may need to post a PR on the project.

IN the meantime, if you use an older numpy, it will likely still work.

2.0 is pretty darn new!

NumPy 2.0 release date: June 16 [2024]

-CHB


Any help would be greatly appreciated.

Thanks,
Jim

--
You received this message because you are subscribed to the Google Groups "pydap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydap+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pydap/7b0490ec-382d-40b2-a1aa-c269934f241en%40googlegroups.com.


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Jim Fluke

unread,
Jul 9, 2024, 4:44:47 PMJul 9
to py...@googlegroups.com
Thanks Chris! Numpy 1.26.4 works. I'll post a PR.

On 7/2/24 13:54, 'Chris Barker' via pydap wrote:

** Caution: EXTERNAL Sender **

Reply all
Reply to author
Forward
0 new messages