Closed inskeepjoey closed 1 year ago
had loaded pygeohydro module: from pygeohydro import WBD
I am not able to reproduce the error, please make sure you have the latest versions of HyRiver packages and their dependencies.
Also, please provide info about your environment, following the issue report guidelines using pygeohydro.show_versions()
. For example, this is mine that works without any issues:
Ok, sounds good. I did double check that the dependencies were up to date, I may have missed something. Thanks.
commit: 4b9748161d8b0ea1955106322499ea680564179a python: 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:41:22) [MSC v.1929 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 165 Stepping 2, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: English_United States.1252 libhdf5: 1.12.2 libnetcdf: 4.8.1
aiodns N/A aiohttp 3.8.4 aiohttp-client-cache 0.8.1 aiosqlite 0.18.0 async-retriever 0.14.0 bottleneck N/A brotli N/A click 8.1.3 cytoolz 0.12.0 dask 2023.1.0 defusedxml 0.7.1 folium 0.14.0 geopandas 0.12.2 h5netcdf 1.1.0 hydrosignatures 0.14.0 lxml 4.9.2 matplotlib 3.7.1 netCDF4 1.6.2 networkx 3.0 numba 0.56.4 numpy 1.23.5 owslib 0.28.1 pandas 1.5.3 py3dep N/A pyarrow 11.0.0 pydaymet N/A pygeohydro 0.14.0 pygeoogc 0.14.0 pygeos 0.14 pygeoutils 0.14.0 pynhd 0.14.0 pynldas2 N/A pyproj 3.4.1 pytest N/A pytest-cov N/A rasterio 1.3.4 requests 2.28.2 requests-cache 1.0.1 richdem N/A rioxarray 0.13.3 scipy 1.10.1 shapely 2.0.1 tables N/A ujson 5.7.0 urllib3 1.26.15 xarray 2022.12.0 xdist N/A yaml N/A -------------------------------~
It seems that your xarray
and python
versions are outdated. Please create a new environment and only install pygeohydro
so we can narrow down the issue. Also, please report the full traceback so I can see which line of code is throwing this error.
I have no idea why but I still get the KeyError: 'layers'. I created a new environment and only installed pygeohydro, as well as made sure that the dependencies were the correct versions. I'm not sure what you mean by full traceback. I only get the KeyError: 'layers' message that I included above in the screen shot.
Can you try running this in an python
REPL instead of notebook? Maybe notebook is suppressing the full traceback. You can just open up a terminal, activate this environment, then type python
and write and run your code there. Unless I see which library at what line of code is throwing this error, there's not much I can do, since I cannot reproduce this error on my end. I just created a new env with mamba create -n test python=3.9 pygeohydro
to be similar to yours and used python
's REPL:
That works when I run in python REPL. I'm curious why notebook is suppressing the full traceback.
I don't know what's wrong with your notebook's instance. I am guessing it has to do with the way that you create python environments that notebook uses.
I'll focus on that for trouble shooting. Thanks for the help.
What happened?
When loading a huc6 byid, received KeyError: "layers"
What did you expect to happen?
Expected huc6 170900 polygon to be loaded into notebook.
Minimal Complete Verifiable Example
No response
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
No response
Environment