Skip to content

Instantly share code, notes, and snippets.

@allixender
Created July 27, 2020 08:47
Show Gist options
  • Save allixender/55b63d5cf49ca7f646625b7303e95f09 to your computer and use it in GitHub Desktop.
Save allixender/55b63d5cf49ca7f646625b7303e95f09 to your computer and use it in GitHub Desktop.
A custom Windows cmd init to develop QGIS 3 plugins
@echo off
SET OSGEO4W_ROOT=C:\dev\OSGeo4W
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\bin\qt5_env.bat
call "%OSGEO4W_ROOT%"\bin\py3_env.bat
@echo off
set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37
set PYTHONPATH=%OSGEO4W_ROOT%\apps\Python37;%OSGEO4W_ROOT%\apps\Python37\Scripts;%OSGEO4W_ROOT%\apps\qgis-ltr\python
path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH%
path O4W_QT_PREFIX=%OSGEO4W_ROOT%\apps\Qt5
set O4W_QT_BINARIES=%OSGEO4W_ROOT%\apps\Qt5\bin
set O4W_QT_PLUGINS=%OSGEO4W_ROOT%\apps\Qt5\plugins
set O4W_QT_LIBRARIES=%OSGEO4W_ROOT%\apps\Qt5\lib
set O4W_QT_TRANSLATIONS=%OSGEO4W_ROOT%\apps\Qt5\translations
set O4W_QT_HEADERS=%OSGEO4W_ROOT%\apps\Qt5\include
set O4W_QT_DOC=%OSGEO4W_ROOT:\=\%\apps\Qt5\doc
set GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
set GDAL_DRIVER_PATH=%OSGEO4W_ROOT%\bin\gdalplugins
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%\apps\qgis-ltr
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis-ltr\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
path %PATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\bin;%OSGEO4W_ROOT%\apps\Python37;%OSGEO4W_ROOT%\apps\Python37\Scripts;%OSGEO4W_ROOT%\apps\qt5\bin;C:\dev\OSGeo4W\bin;C:\Program Files\R\R-3.6.1\bin\x64;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\mingw64;C:\Program Files\Git\usr\bin
cmd.exe
@echo off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment