QGIS中无法激活GRASS GIS provider及工具访问问题求助
QGIS无法访问GRASS工具的问题解决建议
问题描述
无法从QGIS中访问GRASS工具,激活GRASS GIS provider扩展时出现以下错误:
OSError: [WinError 87] 参数不正确 Traceback (most recent call last): File "C:\OSGeo4W/apps/qgis-ltr/./python/plugins\grassprovider\Grass7AlgorithmProvider.py", line 105, in loadAlgorithms version = Grass7Utils.installedVersion(True) File "C:\OSGeo4W/apps/qgis-ltr/./python/plugins\grassprovider\Grass7Utils.py", line 114, in installedVersion with subprocess.Popen( File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line 1436, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 87] 参数不正确 Python版本 : 3.9.18 (heads/master:c290dc6, Jan 14 2024, 01:36:02) [MSC v.1929 64 bit (AMD64)] QGIS版本 : 3.28.15-Firenze Firenze, 252ad49ddc Python路径 : C:/OSGeo4W/apps/qgis-ltr/./python C:/Users/ldesc/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/ldesc/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/OSGeo4W/apps/qgis-ltr/./python/plugins C:\OSGeo4W\apps\grass\grass83\etc\python C:\Users\ldesc\Documents C:\OSGeo4W\bin\python39.zip C:\OSGeo4W\apps\Python39\DLLs C:\OSGeo4W\apps\Python39\lib C:\OSGeo4W\bin C:\OSGeo4W\apps\Python39 C:\OSGeo4W\apps\Python39\lib\site-packages C:\OSGeo4W\apps\Python39\lib\site-packages\win32 C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin C:/Users/ldesc/AppData/Roaming/QGIS/QGIS3\profiles\default/python
已尝试操作:全新安装QGIS最新版、长期支持版,使用OSGeo4W安装,删除AppData及其他残留文件夹,期望解决版本依赖问题,但均无效。
可能的解决方法
- 检查GRASS路径配置:打开QGIS「设置」→「选项」→「处理」→「GRASS GIS」,确认GRASS安装路径为
C:\OSGeo4W\apps\grass\grass83,确保路径无特殊字符或空格;若路径无误,尝试手动指定GRASS可执行文件:C:\OSGeo4W\apps\grass\grass83\bin\grass83.bat。 - 修复OSGeo4W组件:运行OSGeo4W安装器,选择「Advanced Install」→「Repair」,重新安装GRASS与QGIS相关依赖包,确保组件完整。
- 调整系统环境变量:将
C:\OSGeo4W\bin和C:\OSGeo4W\apps\grass\grass83\bin添加到系统PATH变量中,重启电脑后再测试。 - 使用干净配置文件:启动QGIS时按住
Ctrl键,创建新的用户配置文件,排除旧配置的干扰。 - 排查Python路径冲突:移除Python路径中的
C:\Users\ldesc\Documents(若该目录下无必要的自定义脚本),避免与GRASS/QGIS模块冲突。
内容的提问来源于stack exchange,提问作者l.deschamps.biol
相关产品推荐
相关产品推荐

