Skip to content

[Bug] grass -c and interaction with python wrappers #6411

@laurapoggio-sptools

Description

@laurapoggio-sptools

Describe the bug

I am using this code to create a new project from bash:
grass -c EPSG:3035 -e ./GRASSDATA/.

I get this error:

ERROR: No CRS is needed for creating mapset <GRASSDATA>, but <EPSG:3035> was provided as CRS. Did you mean to create a new project?

This is happening on a docker image with Debian13

System description

Base operative system: debian:trixie-slim

grass --version GRASS GIS 8.4.1
gdalinfo --version GDAL 3.11.3 "Eganville", released 2025/07/12
proj --version Rel. 9.6.2, June 4th, 2025
geos-config --version 3.13.1
python --version Python 3.13.5

Additional context

It was difficult to pinpoint the causes of the problem. However we found out it is somehow related to python wrappers.
The solution was to create a wrapper script around grass command that:

  • Detects -c (new project creation) and disable python paths
  • unset of python envs: PYTHONPATH, PYTHON, GRASS_PYTHON, PYTHONHOME, PYTHONUSERBASE,PYTHON3PATH etc
  • Runs project creation and re-sets python envs
  • If NOT -c then it goes ahead with execution of command

Building grass --without-python also solves the problem but the python modules are then missing.

@jorgejesus FYI

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions