Closed davidadbo closed 4 years ago
Hi David,
It looks like the plugin is trying to load sections from your QGIS Project file that don't exist. I'm not sure how that has happened. To recover the project and get Geoscience to load again you will need to tell it that there are no sections (or the correct number of sections) to load. You will need to edit the qgs project file. Look for "<Sections " and change it to 0. [image: image.png]
If you see real sections in the project (denoted by the prefix S00, S01 etc) then you can set it to the correct number (eg 1 if you have S00, 2 if you have S00 & S01).
[image: image.png]
If your project is a qgz, then it is just a zipped qgs. Simply unzip it, edit it then re-zip.
I'll change the code so it doesn't crash if this happens in the future. Thanks for the report.
Regards, Roland
On Sat, 13 Jul 2019 at 03:34, davidadbo notifications@github.com wrote:
Cannot load plugin 'geoscience' due to an error when calling its classFactory() method
I am using QGIS 3.8 but also confirmed on 3.4. Have removed the geoscience folder under python directory and re-installed. Have removed all layers created by the plugin in the active QGIS project and re-installed. None of these attempts rectified the issue.
Here's the error message:
IndexError: list index out of range Traceback (most recent call last): File "C:/PROGRA1/QGIS31.8/apps/qgis/./python\qgis\utils.py", line 334, in
startPlugin plugins[packageName] = package.classFactory(iface) File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience_init.py", line 36, in classFactory return Geoscience(iface) File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\geoscience.py", line 51, in init self.drillManager = DrillManager() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\DrillManager.py", line 65, in init self.readProjectData() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\DrillManager.py", line 774, in readProjectData self.sectionManager.readProjectData() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 686, in readProjectData self.createSection(name, startx, starty, endx, endy, width, layerList, elevationList, False) File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 485, in createSection layer = self.sectionPlanLayer() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 510, in sectionPlanLayer layer = self.createSectionPlanLayer() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 609, in createSectionPlanLayer crs = self.sectionReg[0].sourceLayers[0].crs() IndexError: list index out of range
Thank you for your help.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rolandhill/geoscience/issues/7?email_source=notifications&email_token=AAPOEQ3YPCZFWUDNKWHD5STP7C6CZA5CNFSM4ICOBWGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G653R2A, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPOEQ3HKCI4PU6RBRPD52TP7C6CZANCNFSM4ICOBWGA .
Hi Roland,
Thank you for your reply. It looks like there may have been images in your email but these did not show up. However, I tried to follow the text instructions.
I believe I removed sections in the active project several times through a process of trial and error in testing the plugin (which is useful by the way!) . Here’s what I did:
Cannot load plugin 'geoscience' due to an error when calling its classFactory() method
I am using QGIS 3.8 but also confirmed on 3.4. Have removed the geoscience folder under python directory and re-installed. Have removed all layers created by the plugin in the active QGIS project and re-installed. None of these attempts rectified the issue.
Here's the error message:
IndexError: list index out of range Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.8/apps/qgis/./python\qgis\utils.py", line 334, in _startPlugin plugins[packageName] = package.classFactory(iface) File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience__init.py", line 36, in classFactory return Geoscience(iface) File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\geoscience.py", line 51, in init self.drillManager = DrillManager() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\DrillManager.py", line 65, in init__ self.readProjectData() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\DrillManager.py", line 774, in readProjectData self.sectionManager.readProjectData() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 686, in readProjectData self.createSection(name, startx, starty, endx, endy, width, layerList, elevationList, False) File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 485, in createSection layer = self.sectionPlanLayer() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 510, in sectionPlanLayer layer = self.createSectionPlanLayer() File "C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\DWA/python/plugins\geoscience\SectionManager.py", line 609, in createSectionPlanLayer crs = self.sectionReg[0].sourceLayers[0].crs() IndexError: list index out of range
Thank you for your help.