[osgeo4w-dev] Fiona Rasterio and GDAL cannot be imported in OSGeo4W install Python 3.7

Ross Conner ross.conner at gmail.com
Fri Nov 20 08:42:15 PST 2020


Hello,

I can't import geopandas due to it's dependency on Fiona which has the
following import error:

{{{File "<stdin>", line 1, in <module>
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\fiona\__init__.py",
line 84, in <module>
    from fiona.collection import BytesCollection, Collection
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\fiona\collection.py",
line 9, in <module>
    from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The specified module could not be found.}}}

After reviewing the osgeo4w-dev archives for the last few months I saw that
there were issues with fiona and rasterio so I tried importing rasterio and
I got the following error:

{{{Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\rasterio\__init__.py",
line 22, in <module>
    from rasterio._base import gdal_version
ImportError: DLL load failed: The specified module could not be found.}}}

I then tried to import gdal with {{{ import gdal }}} and {{{ from osgeo
import gdal }}} I got the following error:

{{{Traceback (most recent call last):
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\osgeo\__init__.py",
line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\OSGeo4W64\apps\Python37\lib\importlib\__init__.py", line 127, in
import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\gdal.py", line 2, in
<module>
    from osgeo.gdal import deprecation_warn
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\osgeo\__init__.py",
line 32, in <module>
    _gdal = swig_import_helper()
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\osgeo\__init__.py",
line 31, in swig_import_helper
    return importlib.import_module('_gdal')
  File "C:\OSGeo4W64\apps\Python37\lib\importlib\__init__.py", line 127, in
import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_gdal' }}}

Any help would be appreciated.

Thank you in advance,

Ross Conner
403-612-4468
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/osgeo4w-dev/attachments/20201120/f1ea818e/attachment.html>


More information about the osgeo4w-dev mailing list