0

I'm trying to install this plugin: https://github.com/avinet/qgis-server-font-loader. First I copied the Zip-folder in C:\OSGeo4W64\apps\qgis-ltr\plugins then I opened QGIS and installed the plugin from Zip.

This is the Error:

Konnte Erweiterung 'qgis-server-font-loader-master' nicht laden aufgrund eines Fehlers beim Aufruf der classFactory() Methode 

AttributeError: module 'qgis-server-font-loader-master' has no attribute 'classFactory' 
Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 335, in startPlugin
    plugins[packageName] = package.classFactory(iface)
AttributeError: module 'qgis-server-font-loader-master' has no attribute 'classFactory'


Python-Version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS-Version: 3.4.8-Madeira Madeira, 04ee8e0761 

What am I doing wrong?

0
0

Not sure what you want to achieve. If it's using custom fonts within QGIS Desktop, there is no need for a plugin. Add fonts to your system and use them within QGIS (just need to reopen QGIS if you did not stop it before loading the new fonts). If it's for loading custom fonts in QGIS Server, the plugin is a good help.

Your issue is that you try to load a QGIS server plugin within QGIS Desktop. The error message is

AttributeError: module 'qgis-server-font-loader-master' has no attribute 'classFactory'

Within a QGIS server plugin, the entry point is serverClassFactory e.g https://github.com/avinet/qgis-server-font-loader/blob/master/__init__.py#L3

versus

a "classic" plugin where the entry point for QGIS Desktop is classFactory e.g https://github.com/g-sherman/Qgis-Plugin-Builder/blob/master/__init__.py#L28

That's why QGIS send an error message as it does not found an entry classFactory

"Running QGIS Server is not running QGIS Desktop on a server but running a QGIS component for Server". See the official guide about QGIS Server https://docs.qgis.org/3.16/en/docs/server_manual/index.html

4
  • Thanks for your answer! My primary problem is that I have a custom font. In qgis Desktop the symbology looks good but in the wms service from the local qgis server obvious can´t use the font. I did not installed the qgis server myself so I am a bit confused what the correct path for the plugin is. – Jana Mar 16 at 12:31
  • You need to set/check where variable QGIS_PLUGINPATH is in your Apache/Nginx conf e.g docs.qgis.org/3.16/en/docs/server_manual/… to know where to put your QGIS server plugins. You can find in logs on your QGIS server if plugins loaded successfully – ThomasG77 Mar 16 at 15:16
  • Now I found the config file in the apache. There was this line, so I copied the plugin folder to the first path. SetEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis-ltr\qtplugins;C:\OSGeo4W64\apps\Qt5\plugins;C:\OSGeo4W64\apps\Qt5\bin;C:\OSGeo4W64\bin\gdalplugins" After the restart I tested the wms service, but there was no difference. Then I tried this line but the result was the same. SetEnv QGIS_PLUGINPATH "C:\qgisserverplugins\plugins" In the error.log i didn´t find any hints. – Jana Mar 16 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.