Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLL load failed - fresh python 3.7 environment #269

Closed
magnus-m opened this issue Mar 17, 2019 · 4 comments
Closed

DLL load failed - fresh python 3.7 environment #269

magnus-m opened this issue Mar 17, 2019 · 4 comments

Comments

@magnus-m
Copy link

Issue: DLL load failed - fresh python 3.7 environment

Installing the latest anaconda on windows 10 (Anaconda3-2018.12-Windows-x86_64.exe)
Then:

$conda create -n gdal python=3.7
$conda activate gdal
$conda config --add channels conda-forge
$conda install gdal libgdal
$python
>>>import gdal

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\gdal\lib\site-packages\gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "C:\ProgramData\Anaconda3\envs\gdal\lib\site-packages\osgeo\__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "C:\ProgramData\Anaconda3\envs\gdal\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
  File "C:\ProgramData\Anaconda3\envs\gdal\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\ProgramData\Anaconda3\envs\gdal\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Environment (conda list):
# Name                    Version                   Build  Channel
blas                      1.0                         mkl
boost-cpp                 1.68.0            h6a4c333_1000    conda-forge
bzip2                     1.0.6             hfa6e2cd_1002    conda-forge
ca-certificates           2019.3.9             hecc5488_0    conda-forge
certifi                   2019.3.9                 py37_0    conda-forge
curl                      7.64.0               h4496350_2    conda-forge
expat                     2.2.5             he025d50_1002    conda-forge
freetype                  2.10.0               h5db478b_0    conda-forge
freexl                    1.0.5             hd288d7e_1002    conda-forge
gdal                      2.4.0           py37hdf5ee75_1003    conda-forge
geos                      3.7.1             he025d50_1000    conda-forge
geotiff                   1.4.3             h8408f58_1000    conda-forge
gettext                   0.19.8.1          hb01d8f6_1001    conda-forge
glib                      2.58.3            hc0c2ac7_1001    conda-forge
hdf4                      4.2.13            hf8e6fe8_1002    conda-forge
hdf5                      1.10.4          nompi_hcc15c50_1105    conda-forge
icc_rt                    2019.0.0             h0cc432a_1
intel-openmp              2019.1                      144
jpeg                      9c                hfa6e2cd_1001    conda-forge
kealib                    1.4.10            heacb130_1002    conda-forge
krb5                      1.16.3            hdd46e55_1001    conda-forge
libcurl                   7.64.0               h4496350_2    conda-forge
libffi                    3.2.1             h6538335_1005    conda-forge
libgdal                   2.4.0             he26aab1_1003    conda-forge
libiconv                  1.15              hfa6e2cd_1004    conda-forge
libkml                    1.3.0             h4fd0f3b_1009    conda-forge
libnetcdf                 4.6.2             h396784b_1001    conda-forge
libpng                    1.6.36            h7602738_1000    conda-forge
libpq                     11.2                 hb0bdaea_0    conda-forge
libspatialite             4.3.0a            h6a0152f_1026    conda-forge
libssh2                   1.8.0             h642c060_1004    conda-forge
libtiff                   4.0.10            h36446d0_1001    conda-forge
libxml2                   2.9.8             h9ce36c8_1005    conda-forge
m2w64-expat               2.1.1                         2
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gettext             0.19.7                        2
m2w64-gmp                 6.1.0                         2
m2w64-libiconv            1.14                          6
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
m2w64-xz                  5.2.2                         2
mkl                       2019.1                      144
msys2-conda-epoch         20160418                      1
numpy                     1.11.3          py37h0aa5519_11
numpy-base                1.11.3          py37h2a9b21d_11
openjpeg                  2.3.0             h25a6d84_1003    conda-forge
openssl                   1.1.1b               hfa6e2cd_1    conda-forge
pcre                      8.41              h6538335_1003    conda-forge
pip                       19.0.3                   py37_0    conda-forge
poppler                   0.67.0               heddaa77_6    conda-forge
poppler-data              0.4.9                         1    conda-forge
postgresql                11.2                 h06f7779_0    conda-forge
proj4                     5.2.0             hfa6e2cd_1001    conda-forge
python                    3.7.1             h9460c21_1003    conda-forge
setuptools                40.8.0                   py37_0    conda-forge
sqlite                    3.26.0            hfa6e2cd_1001    conda-forge
tk                        8.6.9             hfa6e2cd_1000    conda-forge
vc                        14                            0    conda-forge
vs2015_runtime            14.0.25420                    0    conda-forge
wheel                     0.33.1                   py37_0    conda-forge
wincertstore              0.2                   py37_1002    conda-forge
xerces-c                  3.2.2             h6538335_1001    conda-forge
xz                        5.2.4             h2fa13f4_1001    conda-forge
zlib                      1.2.11            h2fa13f4_1004    conda-forge


Details about conda and system ( conda info ):

Error:

     active environment : gdal
    active env location : C:\ProgramData\Anaconda3\envs\gdal
            shell level : 2
       user config file : C:\Users\mag\.condarc
 populated config files : C:\Users\mag\.condarc
          conda version : 4.5.12
    conda-build version : 3.17.6
         python version : 3.7.1.final.0
       base environment : C:\ProgramData\Anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/win-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\pkgs
                          C:\Users\mag\AppData\Local\conda\conda\pkgs
       envs directories : C:\ProgramData\Anaconda3\envs
                          C:\Users\mag\AppData\Local\conda\conda\envs
                          C:\Users\mag\.conda\envs
               platform : win-64
             user-agent : conda/4.5.12 requests/2.21.0 CPython/3.7.1 Windows/10 Windows/10.0.17763
          administrator : True
             netrc file : None
           offline mode : False

Any method to run gdal will be of great help :)

@ocefpaf
Copy link
Member

ocefpaf commented Mar 17, 2019

On Windows, because conda-forge relies on some package built with defaults blas (like scipy) one must use the defaults channel on top of conda-forge and activate conda's new strict channel feature.

One can do that with:

conda config --add channels conda-forge
conda config --add channels defaults
conda config --set channel_priority strict

Then you can try to re-install your stack. Note that on Linux and OS X we recommend the opposite order of channels.

@ocefpaf ocefpaf closed this as completed Mar 17, 2019
@magnus-m
Copy link
Author

@ocefpaf That solved the issue. Thank you!

@DishaDudhal
Copy link

Hello @ocepaf, I am facing the same issue however is there a way to resolve this without conda?

@ocefpaf
Copy link
Member

ocefpaf commented May 6, 2020

Hello @ocepaf, I am facing the same issue however is there a way to resolve this without conda?

This is the conda package for gdal, so no. There is no way to solve it without conda :-)

@conda-forge conda-forge locked and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants