EL-BID / red_basica

Other
10 stars 6 forks source link

Problem with installation on QGIS 3.36.3-Maidenhead Maidenhead, 2df96554 #3

Closed hydromac closed 3 months ago

hydromac commented 3 months ago

When I try to install plugin, QGIS give me information: Plugin 'red_basica-dev' failed to load due to an error in calling its classFactory() method

re.error: global flags not at the start of the expression at position 62 Traceback (most recent call last): File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python\qgis\utils.py", line 426, in _startPlugin plugins[packageName] = package.classFactory(iface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev__init.py", line 34, in classFactory from .base.red_basica import RedBasica File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python\qgis\utils.py", line 923, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\base\red_basica.py", line 32, in from ..profile import Profile File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python\qgis\utils.py", line 923, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\profile__init.py", line 5, in from .views.MainView import MainView File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python\qgis\utils.py", line 923, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\profile\views\MainView.py", line 9, in from .. import pyqtgraph as pg File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python\qgis\utils.py", line 923, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\profile\pyqtgraph\init.py", line 202, in from .graphicsItems.VTickGroup import File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python\qgis\utils.py", line 923, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\profile\pyqtgraph\graphicsItems\VTickGroup.py", line 7, in from .. import functions as fn File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python\qgis\utils.py", line 923, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\profile\pyqtgraph\functions.py", line 41, in FLOAT_REGEX = re.compile(r'(?P[+-]?((((\d+(.\d)?)|(\d.\d+))([eE][+-]?\d+)?)|((?i)(nan)|(inf))))\s((?P[u' + SI_PREFIXES + r']?)(?P\w.*))?$') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re\init__.py", line 228, in compile return _compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re\init__.py", line 307, in _compile p = _compiler.compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_compiler.py", line 745, in compile p = _parser.parse(p, flags) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 979, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 460, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 862, in _parse p = _parse_sub(source, state, sub_verbose, nested + 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 460, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 862, in _parse p = _parse_sub(source, state, sub_verbose, nested + 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 460, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 862, in _parse p = _parse_sub(source, state, sub_verbose, nested + 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 460, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\re_parser.py", line 840, in _parse raise source.error('global flags not at the start ' re.error: global flags not at the start of the expression at position 62

Version a Pythona: 3.12.3 (main, Apr 14 2024, 17:21:43) [MSC v.1938 64 bit (AMD64)] Version QGIS: 3.36.3-Maidenhead Maidenhead, 2df96554

Lokalizacja Pythona: C:/PROGRA~1/QGIS33~1.3/apps/qgis/./python C:/Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/PROGRA~1/QGIS33~1.3/apps/qgis/./python/plugins C:\PROGRA~1\QGIS33~1.3\apps\grass\grass83\etc\python C:\Users\hydro\Documents C:\Program Files\QGIS 3.36.3\bin\python312.zip C:\PROGRA~1\QGIS33~1.3\apps\Python312\DLLs C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib C:\Program Files\QGIS 3.36.3\bin C:\Users\hydro\AppData\Roaming\Python\Python312\site-packages C:\Users\hydro\AppData\Roaming\Python\Python312\site-packages\win32 C:\Users\hydro\AppData\Roaming\Python\Python312\site-packages\win32\lib C:\Users\hydro\AppData\Roaming\Python\Python312\site-packages\Pythonwin C:\PROGRA~1\QGIS33~1.3\apps\Python312 C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\win32 C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\win32\lib C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\Pythonwin C:/Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\app\lib C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\profile..\app C:\Users/hydro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\red_basica-dev\profile..\base

fedesanchez commented 3 months ago

Hi, try renaming your folder from red_basica-dev to just red_basica

hydromac commented 3 months ago

It's not help... I renamed the folder to red_basica, but I get the same error message "Plugin 'red_basica' failed to load due to an error in calling its classFactory() method"

martindelloro commented 3 months ago

@hydromac Could you tell us the steps you are taking for the installation?

I just did an installation from scratch importing the zip called red_basica-dev.zip and it worked.

hydromac commented 3 months ago

@martindelloro Yes.

  1. From menu "Plugins" I ran "Manage and Install Plugins..."
  2. Install from "Install from ZIP"
  3. After Installed plugin I see them is checked is "Installed"
  4. I don't see this plugin in Panels and Toolbars in View menu. (attached print screen) redBasica3 redBasica2 redBasica1
hydromac commented 3 months ago

@martindelloro @fedesanchez I would like to ask you and point me to good sources - www instructions that you have checked, based on which I will configure Visual Studio Code with qgis and learn how to debug the plug-in code? I want to find the cause of the problem myself. I have never programmed plugins for qgis. I was interested in your qgis plug-in because I am a professional designer of water supply networks and sanitary and storm sewage systems from Poland and I wanted to test it for my own needs and perhaps suggest additional functionalities that may be useful to other people.

hydromac commented 3 months ago

@martindelloro @fedesanchez I solved the above problem. Replacing the code in the file "red_basica\profile\pyqtgraph\functions.py" from : FLOAT_REGEX = re.compile(r'(?P<number>[+-]?((((\d+(\.\d*)?)|(\d*\.\d+))([eE][+-]?\d+)?)|((?i)(nan)|(inf))))\s*((?P<siPrefix>[u' + SI_PREFIXES + r']?)(?P<suffix>\w.*))?$') to FLOAT_REGEX = re.compile(r'(?i)(?P<value>[+-]?((((\d+(\.\d*)?)|(\d*\.\d+))([eE][+-]?\d+)?)|(nan)|(inf)))\s*((?P<unit>[' + SI_PREFIXES + r']?)(?P<other>\w.*))?$')

leonazareth commented 2 months ago

@hydromac, we are going to implement the suggested code. Thanks!