[MacPorts] #72523: Error in the ‘qgis_process’ tool in QGIS3

MacPorts noreply at macports.org
Thu May 22 08:51:56 UTC 2025


#72523: Error in the ‘qgis_process’ tool in QGIS3
-----------------------+--------------------
 Reporter:  news24lor  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:  2.10.7
 Keywords:  GIS, QGIS  |       Port:
-----------------------+--------------------
 QGIS has a tool called
 [https://docs.qgis.org/3.40/en/docs/user_manual/processing/standalone.html
 QGIS Processing Executor] that allows you to run Processing algorithms and
 models (built-in or provided by plugins) directly from the command line
 without starting QGIS Desktop.
 In QGIS distributed from the official site enter from the terminal::

 {{{
 mlor$ /Applications/QGIS.app/Contents/MacOS/bin/qgis_process
 QGIS Processing Executor - 3.42.1-Münster 'Münster' (3.42.1-Münster)
 Usage:
 /Applications/QGIS.app/Contents/MacOS/bin/../qgis_process.app/Contents/MacOS/qgis_process
 [--help] [--version] [--json] [--verbose] [--no-python] [--skip-loading-
 plugins] [command] [algorithm id, path to model file, or path to Python
 script] [parameters]

 Options:
         --help or -h            Output the help
         --version or -v         Output all versions related to QGIS
 Process
         --json                  Output results as JSON objects
         --verbose               Output verbose logs
         --no-python             Disable Python support (results in faster
 startup)
         --skip-loading-plugins  Avoid loading enabled plugins (results in
 faster startup)
 Available commands:
         plugins         list available and active plugins
         plugins enable  enables an installed plugin. The plugin name must
 be specified, e.g. "plugins enable cartography_tools"
         plugins disable disables an installed plugin. The plugin name must
 be specified, e.g. "plugins disable cartography_tools"
         list            list all available processing algorithms
         help            show help for an algorithm. The algorithm id or a
 path to a model file must be specified.
         run             runs an algorithm. The algorithm id or a path to a
 model file and parameter values must be specified. Parameter values are
 specified after -- with PARAMETER=VALUE syntax. Ordered list values for a
 parameter can be created by specifying the parameter multiple times, e.g.
 --LAYERS=layer1.shp --LAYERS=layer2.shp
                         Alternatively, a '-' character in place of the
 parameters argument indicates that the parameters should be read from
 STDIN as a JSON object. The JSON should be structured as a map containing
 at least the "inputs" key specifying a map of input parameter values. This
 implies the --json option for output as a JSON object.
                         If required, the ellipsoid to use for distance and
 area calculations can be specified via the "--ELLIPSOID=name" argument.
                         If required, an existing QGIS project to use
 during the algorithm execution can be specified via the "--
 PROJECT_PATH=path" argument.
                         When passing parameters as a JSON object from
 STDIN, these extra arguments can be provided as an "ellipsoid" and a
 "project_path" key respectively.
 mlor$
 }}}


 This tool is very powerful and versatile. Each command in QGIS has an
 ‘Advanced’ button at the bottom where you can select the ‘Copy as
 qgis_process command’ from a list. This choice allows you to run the same
 algorithm in QGIS directly from the terminal without any graphical
 interface. This tool can start PyQGIS scripts or models directly from the
 terminal, significantly speeding up complex procedures.

 Unfortunately, in MacPorts' QGIS3 this command does not work, or at least
 has been entered in an incorrect path. The same command in MacPorts' QGIS3
 is in a different path:

 {{{
 mlor$
 /Applications/MacPorts/QGIS3.app/Contents/MacOS/bin/qgis_process.app/Contents/MacOS/qgis_process
 dyld[81258]: Library not loaded:
 @executable_path/../Frameworks/qgis_analysis.framework/qgis_analysis
   Referenced from: <7EF9458B-2DCE-37C9-85AD-C66912AA52E8>
 /Applications/MacPorts/QGIS3.app/Contents/MacOS/bin/qgis_process.app/Contents/MacOS/qgis_process
   Reason: tried:
 '/Applications/MacPorts/QGIS3.app/Contents/MacOS/bin/qgis_process.app/Contents/Frameworks/qgis_analysis.framework/qgis_analysis'
 (no such file)
 Abort trap: 6
 mlor$
 }}}

 The error is obvious: a library that does not exist in that path is called
 up. I moved the tool to another location because of this path. I copied
 the qgis_process tool and, from the terminal, entered:


 {{{
 mlor$ /Applications/MacPorts/QGIS3.app/Contents/MacOS/qgis_process
 QGIS Processing Executor - 3.42.2-Münster 'Münster' (3.42.2-Münster)
 Usage: /Applications/MacPorts/QGIS3.app/Contents/MacOS/qgis_process
 [--help] [--version] [--json] [--verbose] [--no-python] [--skip-loading-
 plugins] [command] [algorithm id, path to model file, or path to Python
 script] [parameters]

 Options:
         --help or -h            Output the help
         --version or -v         Output all versions related to QGIS
 Process
         --json                  Output results as JSON objects
         --verbose               Output verbose logs
         --no-python             Disable Python support (results in faster
 startup)
         --skip-loading-plugins  Avoid loading enabled plugins (results in
 faster startup)
 Available commands:
         plugins         list available and active plugins
         plugins enable  enables an installed plugin. The plugin name must
 be specified, e.g. "plugins enable cartography_tools"
         plugins disable disables an installed plugin. The plugin name must
 be specified, e.g. "plugins disable cartography_tools"
         list            list all available processing algorithms
         help            show help for an algorithm. The algorithm id or a
 path to a model file must be specified.
         run             runs an algorithm. The algorithm id or a path to a
 model file and parameter values must be specified. Parameter values are
 specified after -- with PARAMETER=VALUE syntax. Ordered list values for a
 parameter can be created by specifying the parameter multiple times, e.g.
 --LAYERS=layer1.shp --LAYERS=layer2.shp
                         Alternatively, a '-' character in place of the
 parameters argument indicates that the parameters should be read from
 STDIN as a JSON object. The JSON should be structured as a map containing
 at least the "inputs" key specifying a map of input parameter values. This
 implies the --json option for output as a JSON object.
                         If required, the ellipsoid to use for distance and
 area calculations can be specified via the "--ELLIPSOID=name" argument.
                         If required, an existing QGIS project to use
 during the algorithm execution can be specified via the "--
 PROJECT_PATH=path" argument.
                         When passing parameters as a JSON object from
 STDIN, these extra arguments can be provided as an "ellipsoid" and a
 "project_path" key respectively.
 mlor$
 }}}


 The tool now works but this bug needs to be fixed.

 The qgis_process tool is very powerful and a great help for developers

-- 
Ticket URL: <https://trac.macports.org/ticket/72523>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list