微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ModuleNotFoundError: 没有名为“grass”的模块 |草地地理信息系统 |蟒蛇3 | CentOS 7

如何解决ModuleNotFoundError: 没有名为“grass”的模块 |草地地理信息系统 |蟒蛇3 | CentOS 7

我想在 amazon-linux 机器上运行grass78,有centOS,没有GUI。好不容易安装了 GRASS78(https://grass.osgeo.org/download/ 的最新稳定版本)。

当我运行以下命令时(在将 GRASS_GUI env var 设置为 text 之后)

(.venv) [ec2-user@ip-10-0-3-14 volume_calc]$ grass78
Starting GRASS GIS...
ERROR: Path '/home/ec2-user/volume_calc/<UNKNowN>/<UNKNowN>' doesn't exist
Exiting...

我想,有了这个,我可以确定草已经安装好了。

但是请告诉我是否有适当的文档来安装它。我试过这个 (https://copr.fedorainfracloud.org/coprs/neteler/grass78/) 但它失败了,因为 centos7 缺少一个 epel 文件

现在,我想运行一个 python 脚本,它会给我传递给脚本的多边形对象的体积。我不确定,以哪种方式运行 GRASS。我必须明确启动 Grass 还是使用它 (https://grasswiki.osgeo.org/wiki/GRASS_Python_Scripting_Library)?

另外,我不确定在启动 GRASS 之前需要设置哪些环境变量。 我已经设置了 GRASSBINGISBASEGISDBASE。但我不确定 MAPSETLOCATION 环境变量的值。

而且,每次我使用

from grass.script import gcore

我收到没有找到名为草的模块的错误

因为我使用的是 centOS,所以我不能做任何类似 sudo apt install grass-core 的事情。当我这样做时,sudo yum install grass 出于某种原因安装了版本grass6.4.4。

我也尝试使用grass_session (pip install grass_session) 在GRASS 会话中运行代码,但没有运气,二进制文件(即/usr/local/bin/grass78)本身说没有名为grass 的模块.

我正在终端上运行以下命令。

grass78 -c epsg:4326 location --exec python3 /home/ec2-user/volume_calc/grass_calc_vol.py area_file=/home/ec2-user/volume_calc/media/tour_id/temp-testing/area_file.geojson  points_file=/home/ec2-user/volume_calc/media/tour_id/temp-testing/points_file.geojson  dsm_file=/home/ec2-user/volume_calc/media/tour_id/files/dsm-volume.tif
Starting GRASS GIS...
Creating new GRASS GIS location <location>...
Traceback (most recent call last):
  File "/usr/local/bin/grass78",line 2349,in <module>
    main()
  File "/usr/local/bin/grass78",line 2249,in main
    geofile=params.geofile,create_new=True)
  File "/usr/local/bin/grass78",line 1003,in set_mapset
    create_location(gisdbase,location_name,geofile)
  File "/usr/local/bin/grass78",line 794,in create_location
    from grass.script import core as gcore  # pylint: disable=E0611
ModuleNotFoundError: No module named 'grass'

如果您需要更多关于grass_calc_vol 文件的信息,请告诉我。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?