Search code examples
spydergdal

How to solve Import gdal error in 64-bit anaconda?


I have installed 64-bit anaconda,however error popup when I want to import gdal in Spyder? Error information is following,I have search stack overflow and tried their solutions but they all failed. Then, I want to inquiry the specific reasons for the error? THX.

Traceback (most recent call last):

  File "<ipython-input-4-ee38efafc30b>", line 1, in <module>
    import gdal

  File "D:\Anaconda2\lib\site-packages\gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn

  File "D:\Anaconda2\lib\site-packages\osgeo\__init__.py", line 25, in <module>
    _gdal = swig_import_helper()

  File "D:\Anaconda2\lib\site-packages\osgeo\__init__.py", line 21, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)

ImportError: DLL load failed: The specified procedure could not be found.

Solution

  • I have solved the problem perplexing for a long time.

    Method:

    I typed the following command sentence in Anaconda Prompt.

    conda install -c conda-forge georasters

    Result:

    No error in spyder Ipython console. As is the following picture.

    enter image description here

    Tens of packages are installed, some are upgraded, a package removed and some are downgraded. Screenshot of a part of packages installed situation is in following hyperlink.

    enter image description here