[osgeo4w-dev] [osgeo4w] #649: Installing Fiona, Geopandas or rasterio using OSGeo4W breaks QGIS python

OSGeo4W trac_osgeo4w at osgeo.org
Sun Nov 8 20:15:34 PST 2020


#649: Installing Fiona, Geopandas or rasterio using OSGeo4W breaks QGIS python
----------------------+-------------------------------------
Reporter:  cratcliff  |      Owner:  osgeo4w-dev@…
    Type:  defect     |     Status:  new
Priority:  critical   |  Component:  Package
 Version:             |   Keywords:  fiona geopanda rasterio
----------------------+-------------------------------------
 I am installing fiona, geopandas and rasterio for python 3 using OSGeo4w
 on Windows 10 for use with QGIS 3.14.1 and above.

 After installing each of these independently, the python console in QGIS
 breaks and I am getting the following message
 {{{
 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'

 }}}

 How do I fix this to be able to use QGIS and these packages.

-- 
Ticket URL: <https://trac.osgeo.org/osgeo4w/ticket/649>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the osgeo4w-dev mailing list