inasafe / inasafe

InaSAFE - QGIS plugin for estimating impact from natural disasters
www.inasafe.org
GNU General Public License v3.0
260 stars 135 forks source link

Problem loading InaSAFE plugin and running git submodule update #5033

Open Charlotte-Morgan opened 6 years ago

Charlotte-Morgan commented 6 years ago

Problem

Problem loading InaSAFE plugin. I have cloned InaSAFE code and checked out version-4.4.0 but am not able to load it in QGIS. The first message is about parameters and running git submodule update before a restart. I have done this and continue to get the same user message. image

BTW - git submodule update does not appear to do anything image

If I ignore this and continue to the plugin manager I get an error about a missing module named parameters.float_parameters image

Error message is below:

Couldn't load plugin inasafe due to an error when calling its classFactory() method 

ImportError: No module named parameters.float_parameter 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 333, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\__init__.py", line 90, in classFactory
    from safe.plugin import Plugin
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\__init__.py", line 29, in 
    from safe.common.custom_logging import setup_logger
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\__init__.py", line 29, in 
    from safe.common.custom_logging import setup_logger
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\common\custom_logging.py", line 34, in 
    from safe.common.utilities import log_file_path  # NOQA
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\common\utilities.py", line 25, in 
    from safe.utilities.rounding import (
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\utilities\rounding.py", line 10, in 
    from safe.definitions.units import unit_mapping, nominal_mapping
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\definitions\__init__.py", line 15, in 
    from safe.definitions.exposure import *
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\definitions\exposure.py", line 13, in 
    from safe.definitions.field_groups import population_field_groups
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\definitions\field_groups\__init__.py", line 4, in 
    from field_groups import *
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\definitions\field_groups\field_groups.py", line 6, in 
    from safe.definitions.field_groups.age_field_group import (
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\definitions\field_groups\age_field_group.py", line 5, in 
    from safe.definitions.fields import (
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\definitions\fields.py", line 2959, in 
    from safe.definitions.minimum_needs import minimum_needs_fields  # noqa
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\definitions\minimum_needs.py", line 10, in 
    from safe.common.parameters.resource_parameter import ResourceParameter
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/charl/.qgis2/python/plugins\inasafe\safe\common\parameters\resource_parameter.py", line 13, in 
    from parameters.float_parameter import FloatParameter  # NOQA
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named parameters.float_parameter

Python version: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] 
QGIS version: 2.18.23 Las Palmas, 33e81905f4 

Python Path:
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python
C:/Users/charl/.qgis2/python
C:/Users/charl/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins
C:\PROGRA~1\QGIS2~1.18\bin\python27.zip
C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.18\bin
C:\PROGRA~1\QGIS2~1.18\apps\Python27
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/charl/.qgis2//python
C:/Users/charl/.qgis2/python/plugins\inasafe
C:\Users\charl\.qgis2\python\plugins\inasafe\safe_extras\parameters
C:\Users\charl\.qgis2\python\plugins
C:/Users/charl/.qgis2/python/plugins\inasafe

Expected Behaviour

User can switch neatly between versions; user messages help the user to resolve problems.

Environment

Checklist:

Proposed Solution

Maybe some more instructions on how to swich versions and keep it happy

Charlotte-Morgan commented 6 years ago

I've revisited #4090 and see that I need to run 'git submodule init' before I run 'git submodule update' when I install on a new machine. Of course everything is working well now. May I propose a slight update to the user warning message to help people with new installs in future?