Closed jmon12 closed 2 years ago
I just found the version history of the plugin and everything seems to match. Forget about my note.
I could finally install the version 1.1.6 from ZIP using the corresponding dialog in QGIS. Note that I did the following manipulations from the .zip
downloaded from that repository:
pyrcc5 -o resources_rc.py resources.qrc
where necessary since there is no CMake/Qmake file.QgisPlugin
or whatever without the version number.Compress using zip -r QgisPlugin.zip QgisPlugin
.
Note that the naming (points 3. and 4.) is important. It seems to be related with the way QGIS loads the modules: having the version number at the end as -x.x.x
for the directory name (not the name of the zip file) leads to the following error (using QgisPlugin-1.1.6
):
Couldn't load plugin 'QgisPlugin-1.1.6'
ModuleNotFoundError: No module named 'QgisPlugin-1' Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/qgis/utils.py", line 401, in loadPlugin import(packageName) File "/usr/lib/python3.10/site-packages/qgis/utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'QgisPlugin-1'
So my conclusion is that it is a **packaging issue**, either:
- The `.qrc` resources are not built
- The "archive naming" issue
Hello, thanks for reporting the problem.
I've tried installing the plugin on Win10 with QGIS QGIS v3.24.3 and on Ubuntu18 with QGGIS v3.16 from the qgis store and it seems to work.
I'm updating my Ubuntu to install a QGIS v3.24 and it does more tests...
Can you try to install the plugin from a release zip (with compiled resources)? from:
In the QGIS documentation on how to publish a plugin, they explicitly request not to publish compiled resource files (section 16.4.2. Code and help): https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/plugins/releasing.html
Anyway, if you want to compile the plugin resources from source code, you should be aware that we use more than one resource file (one for the plugin and three more for different dialogs)
Thank you for your quick answer and tests. Retrying:
Yes I'm aware that there are 4 resources and I compiled all of them manually, or I wouldn't have succeeded when installing from ZIP.
Concerning the directory name in the ZIP archive, dots are indeed probably the issue. The default name I get downloading from the releases is QgisPlugin-1.1.6.zip
, and the name of the directory inside the archive has the same name. That's not the case when it is downloaded from the QGIS plugin page: the file is called OpenICGC-1.1.6.zip
but the folder in the archive is called OpenICGC
.
For the resources and compiled resource files, note that it seems that you're doing the opposite of the QGIS guidelines. In the ZIP downloaded from the QGIS plugin page, I find the following files:
resources_rc.py
, qlib3/photosearchselectiondialog/resources_rc.py
, qlib3/geofinderdialog/resources_rc.py
and qlib3/base/resources_rc.py
qlib3/photosearchselectiondialog/resources.qrc
Hope theses details can help. Don't hesitate to come back to me if you do further tests and I can help.
Well, I'm glad it's finally working out for you.
You're right, I had a compiled resource file left in the git source code, I've already deleted it, thanks.
I have looked at the code repository of different plugins published in the qgis store and it seems that there are differences in criteria, some leave the compiled resources on github and others do not...
As I understand (perhaps wrongly):
That's why in github releases I leave a zip with compiled resources (and a correct folder name without development files) and github generates another zip (automatically) with the non-compiled resources (and with a problematic folder name that includes the tag of version)
What do you think?
Your analysis of the situation makes sense, and the QGIS guidelines for that matter are quite imprecise.
Thank you for following up!
Problem
Trying to install the plugin in the standard way from the "Manage and install plugins" menu of QGIS, I receive the following error:
Plugin installation failed: The specified configuration cannot be used.
. The console doesn't say more.I'm new to QGIS and I'm not able to get more verbose information after having looked into the documentation, I would be glad to give you more info if you guide me a little bit. See versioning information below.
Note
There seems to be a versioning mismatch between this git repository and the plugin repository of QGIS:
1.1.6
has been updated the 25/05/2022 [today]1.1.6
is said to have been updated the 21/10/2020Versioning