[QGIS-Developer] Unable to compile QGIS3 plugin

KOHLMANN Hannes H.KOHLMANN at ove.at
Fri Mar 16 03:25:54 PDT 2018


Hey Sophie!

Exactly. You first call …/pyrcc.bat without any arguments, and the console tells you what arguments pyrcc.bat takes.
Then you change directory, away from the pyrcc.bat and try to call after having changed to the directory where your resource file is.

Remain in the folder where the pyrcc5.bat is (otherwise the console will not know the command) and give the absolute paths of your target files in quotation mark (in case you have whitespaces in your dirs.) like I did in the below screenshot.

You might encounter the same problem with the pyuic5.bat -> which you use, when you want to translate the .ui file to python code with the pyqt5 bindings. In that case, I built myself a .bat file with the following commands, making the same as Jürgen suggested, (just in case of further tampering attempts ;) )

REM take all .ui files and apply it to the pyuic5.bat to all of them and output them as .py files
REM when calling this batch file the first argument needs to be the path to /python36/script
pushd %~dp0
echo off
call c:
cd %1
cd ../../../bin/
call "o4w_env.bat"
call qt5_env.bat
call py3_env.bat

path %OSGEO4W_ROOT%\apps\qgis-dev\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis-dev
set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis-dev\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis-dev\python;%PYTHONPATH%

echo off

popd
for %%i in (*.ui) do (
                call "%1\pyuic5.bat" -o "%%~ni.py" "%%~ni.ui"
)

I hope that helped

Cheers,
Hannes


[cid:image006.png at 01D3BD18.F7381970]

Von: Sophie Crommelinck [mailto:sophie.crommelinck at gmail.com]
Gesendet: Freitag, 16. März 2018 10:53
An: KOHLMANN Hannes; jef at norbit.de
Cc: qgis-developer at lists.osgeo.org
Betreff: Re: [QGIS-Developer] Unable to compile QGIS3 plugin

I think my images broke while sending,
here they are again:

Jürgen's suggestion:
[cid:image002.jpg at 01D3BD19.8B6D6230]
Hannes' suggestion:
[cid:image004.jpg at 01D3BD19.8B6D6230]
python-core.bat
[cid:image005.png at 01D3BD16.85DD2830]


2018-03-16 10:45 GMT+01:00 Sophie Crommelinck <sophie.crommelinck at gmail.com<mailto:sophie.crommelinck at gmail.com>>:
Hello Jürgen and Hannes,
thanks for your support. I tried both suggestions, with little success.
Jürgen's suggestion:
[http://?ui=2&ik=ad514a8e24&view=att&th=1622e15a2bbbae15&attid=0.1&disp=safe&realattid=ii_jetq74350_1622e15a2bbbae15&zw]
This creates the resources.py file (attached). However, when I open QGIS3 it crashes every time I reload the plugin (crash report attached).
Hannes' suggestion:
[http://?ui=2&ik=ad514a8e24&view=att&th=1622e24472fdda7d&attid=0.2&disp=safe&realattid=ii_jetqrnzt1_1622e24472fdda7d&zw]
which results in the same as above. However, here I am not entirely sure if I followed the suggestion correctly as I go back to the plugin folder for compiling.
Also, I wonder, why the result of calling python-qgis-dev.bat lists win32, while I have a win64 machine.

I also tried changing the python path as suggested in the stack exchange question to Python36 in C:\OSGeo4W64\etc\ini\python-core without success
[http://?ui=2&ik=ad514a8e24&view=att&th=1622e29d99d79ebd&attid=0.0.3&disp=safe&realattid=ii_jetqzhre4_1622e29d99d79ebd&zw]
Best,
Sophie




2018-03-16 1:11 GMT+01:00 KOHLMANN Hannes <H.KOHLMANN at ove.at<mailto:H.KOHLMANN at ove.at>>:
Hey Sophie!

There is one .bat file that does all the work of setting the Environment variables properly: /osgeo4w_root/bin/python-qgis-dev.bat
Call that file in the console and in the same console cd to the directory with the pyrcc.bat file (osgeo4w_root/apps/python36/scripts)

Here is the link to a gis.stackexchange question concerning that:
https://gis.stackexchange.com/questions/260743/how-to-compile-qtdesigner-user-interface-ui-and-resource-qrc-files-with-qg/264377#264377

Good luck and compiling ;)

Cheers,
Hannes
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer at lists.osgeo.org<mailto:QGIS-Developer at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180316/f01cb66f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 2629 bytes
Desc: image005.png
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180316/f01cb66f/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 22189 bytes
Desc: image006.png
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180316/f01cb66f/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 9946 bytes
Desc: image002.jpg
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180316/f01cb66f/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 19565 bytes
Desc: image004.jpg
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180316/f01cb66f/attachment-0003.jpg>


More information about the QGIS-Developer mailing list