CSIRO-Precision-Agriculture / PAT_QGIS_Plugin

PAT is a QGIS plugin containing a collection of tools for processing precision agriculture data.
Other
25 stars 8 forks source link

Installing PAT plugin breaks QGIS python #51

Closed cratcliff closed 3 years ago

cratcliff commented 3 years ago

I am getting the following error after installing PAT

Failed to open Python console:

Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\osgeo\osr.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 670, in _load_unlocked
  File "", line 583, in module_from_spec
  File "", line 1043, in create_module
  File "", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified procedure could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "", line 1, in 
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins\processing\__init__.py", line 35, in 
    from processing.tools.raster import *  # NOQA
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins\processing\tools\raster.py", line 26, in 
    from osgeo import gdal
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\osgeo\gdal.py", line 1756, in 
    import osgeo.ogr
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\osgeo\ogr.py", line 260, in 
    import osgeo.osr
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 743, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\osgeo\osr.py", line 17, in 
    _osr = swig_import_helper()
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\osgeo\osr.py", line 16, in swig_import_helper
    return importlib.import_module('_osr')
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_osr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 2, in 
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\console\console.py", line 47, in show_console
    _console = PythonConsole(parent)
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\console\console.py", line 83, in __init__
    self.console = PythonConsoleWidget(self)
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\console\console.py", line 113, in __init__
    self.shell = ShellScintilla(self)
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\console\console_sci.py", line 104, in __init__
    self.runsource(line)
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\console\console_sci.py", line 679, in runsource
    return super(ShellScintilla, self).runsource(source, filename, symbol)
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\code.py", line 74, in runsource
    self.runcode(code)
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\code.py", line 94, in runcode
    self.showtraceback()
  File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\code.py", line 148, in showtraceback
    sys.excepthook(ei[0], ei[1], last_tb)
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\console\console_sci.py", line 675, in excepthook
    self.write("".join(traceback.format_exception(etype, value, tb)))
  File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\console\console_sci.py", line 660, in write
    sys.stderr.write(txt)
AttributeError: 'NoneType' object has no attribute 'write'
cratcliff commented 3 years ago

This is a QGIS problem and will be fixed in 3.18

for a quick fix see https://trac.osgeo.org/osgeo4w/ticket/649 see [​QGIS/pull/39905] (​https://github.com/qgis/QGIS/pull/39905)

Will be fixed in PAT v1.0.2

cratcliff commented 3 years ago

Fixed in PAT v1.0.2