I'm following Building a Python Plugin (QGIS3) tutorial to set up the development environment for building QGIS3 python plugins in Win10.
I have a problem compiling "pyrcc5".
As explained in the tutorial I wrote the compile.bat
:
@echo off
call "C:\Program Files\QGIS 3.4\bin\o4w_env.bat"
call "C:\Program Files\QGIS 3.4\bin\qt5_env.bat"
call "C:\Program Files\QGIS 3.4\bin\py3_env.bat"
@echo on
pyrcc5.bat -o resources.py resources.qrce
I copied compile.bat
in the plugin folder and run from cmd but I had the follow error:
"C:\PROGRA~1\QGIS" is not recognized as an internal or external command, an executable program or batch file.
I also follow this suggestion and substituted the content of compile file with this:
@ECHO OFF
set OSGEO4W_ROOT="C:\Program Files\QGIS 3.4"
set PATH=%OSGEO4W_ROOT%\bin;%PATH%
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
@echo off
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
call "%OSGEO4W_ROOT%\bin\qt5_env.bat"
call "%OSGEO4W_ROOT%\bin\py3_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\qgis-dev\bin;%OSGEO4W_ROOT%\apps\grass\grass-7.2.2\lib;%OSGEO4W_ROOT%\apps\grass\grass-7.2.2\bin;%PATH%
cd /d %~dp0
@ECHO ON
::Ui Compilation
call pyuic5 save_attribute_dialog.ui --from-imports -o save_attribute_dialog.py
::Resources
call pyrcc5 ui\resources.qrc -o gui\generated\resources_rc.py
@ECHO OFF
GOTO END
:ERROR
echo "Failed!"
set ERRORLEVEL=%ERRORLEVEL%
pause
:END
@ECHO ON
But I have the same error. How do I solve it?
compile.bat
in the plugin folder and it should createpyrcc5
.save_attribute
folder in C:\Users\...\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ , run both the compile.bat file but I have the same error.pyrcc5
. However, make sure that you are using QGIS version of 3.4. If you are using different version like 3.6, you need to change QGIS 3.4 in all the paths in the batch file to QGIS 3.6.