OSGeo / grass-addons

GRASS GIS Addons Repository
https://grass.osgeo.org/grass-stable/manuals/addons/
GNU General Public License v2.0
98 stars 149 forks source link

[Bug] t.stac: failure with No module named 'staclib' #1187

Open neteler opened 3 weeks ago

neteler commented 3 weeks ago

Name of the multi-addon t.stac

Describe the bug

When attempting to install it, the import fails:

grass8.dev --tmp-project XY --exec g.extension t.stac
Fetching <t.stac> from <https://github.com/OSGeo/grass-addons/> (be
patient)...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 38 (delta 8), reused 14 (delta 4), pack-reused 9 (from 1)
Receiving objects: 100% (38/38), 36.69 KiB | 383.00 KiB/s, done.
Resolving deltas: 100% (8/8), done.
Already on 'grass8'
Your branch is up to date with 'origin/grass8'.
Compiling...
Traceback (most recent call last):
  File "/home/mneteler/tmp/grass8-mneteler-1155077/tmph0wkxqb3/t.stac/grass_addons/src/temporal/t.stac/scripts/t.stac.item", line 283, in <module>
    import staclib as libstac
ModuleNotFoundError: No module named 'staclib'
make[1]: *** [/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include/Make/Html.make:14: t.stac.item.tmp.html] Error 1
Installing...
/usr/bin/install: cannot stat '/home/mneteler/tmp/grass8-mneteler-1155077/tmph0wkxqb3/t.stac/grass_addons/src/temporal/t.stac/docs/html/t.stac.item.html': No such file or directory
make[1]: *** [/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include/Make/Script.make:36: install] Error 1
make: *** [/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include/Make/Dir.make:19: installsubdirs] Error 2
WARNING: Installation failed, sorry. Please check above error messages.

Expected behavior

Do not fail :)

Interestingly, a local installation (rather that g.extension) works:

cd  grass-addons/src/temporal/t.stac/
make MODULE_TOPDIR=~/software/grass_main/
...
# no errors.

So there seems to be an issue with g.extension and t.stac.

System description

echoix commented 3 weeks ago

Is it something to do with Python requirements not installed?

ecodiv commented 3 weeks ago

As a check, I can install it without problems on Ubuntu 24.04

As a separate issue, I guess, the modules do not appear in the toolbox panel, but can be run from the console/terminal

neteler commented 3 weeks ago

As a check, I can install it without problems on Ubuntu 24.04

Did you use g.extension as above?

veroandreo commented 3 weeks ago

Using the same command @neteler provided (and also trying from within a grass session), I also get error but with pystac-client:

grass-dev --tmp-project XY --exec g.extension t.stac
Fetching <t.stac> from <https://github.com/OSGeo/grass-addons/> (be
patient)...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 38 (delta 8), reused 14 (delta 4), pack-reused 9 (from 1)
Receiving objects: 100% (38/38), 36.69 KiB | 7.34 MiB/s, done.
Resolving deltas: 100% (8/8), done.
Already on 'grass8'
Your branch is up to date with 'origin/grass8'.
Compiling...
Traceback (most recent call last):
  File "/tmp/grass8-vandreo-247676/tmpy21l0cr7/t.stac/grass_addons/src/temporal/t.stac/scripts/t.stac.catalog", line 72, in <module>
    from pystac_client import Client
ModuleNotFoundError: No module named 'pystac_client'
make[1]: *** [/home/vandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/include/Make/Html.make:14: t.stac.catalog.tmp.html] Error 1
Traceback (most recent call last):
  File "/tmp/grass8-vandreo-247676/tmpy21l0cr7/t.stac/grass_addons/src/temporal/t.stac/scripts/t.stac.collection", line 80, in <module>
    from pystac_client import Client
ModuleNotFoundError: No module named 'pystac_client'
make[1]: *** [/home/vandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/include/Make/Html.make:14: t.stac.collection.tmp.html] Error 1
Traceback (most recent call last):
  File "/tmp/grass8-vandreo-247676/tmpy21l0cr7/t.stac/grass_addons/src/temporal/t.stac/scripts/t.stac.item", line 266, in <module>
    from pystac_client import Client
ModuleNotFoundError: No module named 'pystac_client'
make[1]: *** [/home/vandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/include/Make/Html.make:14: t.stac.item.tmp.html] Error 1
Installing...
/usr/bin/install: cannot stat '/tmp/grass8-vandreo-247676/tmpy21l0cr7/t.stac/grass_addons/src/temporal/t.stac/docs/html/t.stac.catalog.html': No such file or directory
make[1]: *** [/home/vandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/include/Make/Script.make:36: install] Error 1
/usr/bin/install: cannot stat '/tmp/grass8-vandreo-247676/tmpy21l0cr7/t.stac/grass_addons/src/temporal/t.stac/docs/html/t.stac.collection.html': No such file or directory
make[1]: *** [/home/vandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/include/Make/Script.make:36: install] Error 1
/usr/bin/install: cannot stat '/tmp/grass8-vandreo-247676/tmpy21l0cr7/t.stac/grass_addons/src/temporal/t.stac/docs/html/t.stac.item.html': No such file or directory
make[1]: *** [/home/vandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/include/Make/Script.make:36: install] Error 1
make: *** [/home/vandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/include/Make/Dir.make:19: installsubdirs] Error 2
WARNING: Installation failed, sorry. Please check above error messages.

@cwhite911: Are all these lazy imports? or can they be?

ecodiv commented 3 weeks ago

As a check, I can install it without problems on Ubuntu 24.04

Did you use g.extension as above?

Yes, and also after first starting up grass and then using g.extension (I did have to install some libraries, like stac-client and pystac-client).