<div dir="ltr">QGIS list:<div><br></div><div>I have tried to find the answer for this and hope the user community can help.  I need a robust and consistent way to determine the QGIS version on the command line that I can call from a bat file on Windows (and similar on Linux), something like:  qgis-bin.exe --version</div><div><br></div><div><div>Background:  I am developing a complex Python tool that uses PyQGIS and PyQt and is distributed as a virtual environment (venv) created using a specific version of QGIS Python, for example QGIS 3.10 python37.  The deployed environment requires that QGIS is installed separately  The run script modifies its PYTHONPATH to include packages for PyQGIS and the application. The venv includes a text file that indicates the QGIS version that the venv was built with and verifies that a compatible QGIS is installed.  The run script properly handles the typical case where stand-alone QGIS is installed because it looks at the file path, such as C:\Program Files\QGIS 3.10.  If it finds a match, then that version of QGIS is used in PYTHONPATH and the application starts OK.</div><div><br></div><div>The problem is that if someone has not installed a stand-alone QGIS but has installed OSGeo464 version (C:\OSGeo4W64), there is no indicator of QGIS version in the installation folder.   I cannot find documentation for qgis-bin.exe command line options and experiments did not show support for --version or variants.  I could scrape the QGIS version from files somewhere in the distribution but looking into the code it seems to get complicated due to handoff from Python to C/C++ code.  If I can determine the version I can check to make sure that the OsGeo4W64 QGIS version matches that of the distributed venv.  Lacking this, the run script cannot do the check.  Supporting OSGeo4W64 is needed because some development and deployed environments use it.  My plan B is to write a simple Python program to access the version from the Python side, making general assumptions to get started, and then configure the main application startup.</div><div><br></div><div>Any help would be appreciated.<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>Steve Malers<br></div><div>Chief Executive Officer and Chief Technology Officer<br></div><div>Open Water Foundation<br></div><div><a href="http://openwaterfoundation.org" target="_blank">openwaterfoundation.org</a></div></div><div>Support the Open Water Foundation by selecting on <a href="https://smile.amazon.com/ch/46-2676240" target="_blank">smile.amazon.com</a></div><div><span style="font-size:12.8px">Open data.  Open software.   Open decisions.... with positive social impact.</span></div></div></div></div></div></div></div></div></div></div></div></div></div></div>