Closed kurt-rhee closed 4 years ago
I am having the same issue. I've also tried changing my gdal version from 2.4.2 to 2.4.1 but this did not fix it.
Also, and I'm not sure if this is related, but
from osgeo import gdal
also gives a similar error
ImportError: DLL load failed: The specified module could not be found.
Perhaps that helps with something?
It also seems like I can get fiona 1.8.4 working with gdal 2.3.3 (geopandas 0.4.1), but it doesn't work when bundled into an EXE file
Just tried this on Windows and everything worked for me:
conda create --name TEST python=3.6 fiona --yes
conda activate TEST
python -c "import fiona; print(fiona.__version__)"
1.8.6
Here is my package list:
attrs 19.1.0 py_0 conda-forge
boost-cpp 1.70.0 h6a4c333_2 conda-forge
bzip2 1.0.8 hfa6e2cd_1 conda-forge
ca-certificates 2019.9.11 hecc5488_0 conda-forge
certifi 2019.9.11 py36_0 conda-forge
cfitsio 3.470 hfa6e2cd_2 conda-forge
click 7.0 py_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.5.0 py_0 conda-forge
curl 7.65.3 h4496350_0 conda-forge
expat 2.2.5 habb2df7_1003 conda-forge
fiona 1.8.6 py36h2979200_4 conda-forge
freetype 2.10.0 h563cfd7_1 conda-forge
freexl 1.0.5 hd288d7e_1002 conda-forge
gdal 2.4.2 py36he6b6c38_4 conda-forge
geos 3.7.2 he025d50_1 conda-forge
geotiff 1.5.1 h8f84788_2 conda-forge
gettext 0.19.8.1 hb01d8f6_1002 conda-forge
glib 2.58.3 hc0c2ac7_1002 conda-forge
hdf4 4.2.13 hf8e6fe8_1002 conda-forge
hdf5 1.10.5 nompi_ha405e13_1103 conda-forge
icu 64.2 he025d50_1 conda-forge
intel-openmp 2019.4 245 defaults
jpeg 9c hfa6e2cd_1001 conda-forge
kealib 1.4.10 hf7dc31f_1005 conda-forge
krb5 1.16.3 hdd46e55_1001 conda-forge
libblas 3.8.0 12_mkl conda-forge
libcblas 3.8.0 12_mkl conda-forge
libcurl 7.65.3 h4496350_0 conda-forge
libffi 3.2.1 h6538335_1006 conda-forge
libgdal 2.4.2 h2bdb96c_4 conda-forge
libiconv 1.15 hfa6e2cd_1005 conda-forge
libkml 1.3.0 h4ece8bf_1010 conda-forge
liblapack 3.8.0 12_mkl conda-forge
libnetcdf 4.6.2 h376842a_1003 conda-forge
libpng 1.6.37 h7602738_0 conda-forge
libpq 11.5 hb0bdaea_1 conda-forge
libspatialite 4.3.0a h832c139_1029 conda-forge
libssh2 1.8.2 h642c060_2 conda-forge
libtiff 4.0.10 h6512ee2_1003 conda-forge
libxml2 2.9.9 h9ce36c8_5 conda-forge
lz4-c 1.8.3 he025d50_1001 conda-forge
m2w64-expat 2.1.1 2 defaults
m2w64-gcc-libgfortran 5.3.0 6 defaults
m2w64-gcc-libs 5.3.0 7 defaults
m2w64-gcc-libs-core 5.3.0 7 defaults
m2w64-gettext 0.19.7 2 defaults
m2w64-gmp 6.1.0 2 defaults
m2w64-libiconv 1.14 6 defaults
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 defaults
m2w64-xz 5.2.2 2 defaults
mkl 2019.4 245 defaults
msys2-conda-epoch 20160418 1 defaults
munch 2.3.2 py_0 conda-forge
numpy 1.17.2 py36hc71023c_0 conda-forge
openjpeg 2.3.1 hb24c2e3_1 conda-forge
openssl 1.1.1c hfa6e2cd_0 conda-forge
pcre 8.41 h6538335_1003 conda-forge
poppler 0.67.0 h92819f6_7 conda-forge
poppler-data 0.4.9 1 conda-forge
postgresql 11.5 h06f7779_1 conda-forge
proj4 6.1.0 hc2d0af5_2 conda-forge
python 3.6.7 he025d50_1005 conda-forge
setuptools 41.2.0 py36_0 conda-forge
shapely 1.6.4 py36ha35856d_1006 conda-forge
six 1.12.0 py36_1000 conda-forge
sqlite 3.29.0 hfa6e2cd_1 conda-forge
tk 8.6.9 hfa6e2cd_1003 conda-forge
vc 14.1 h0510ff6_4 defaults
vs2015_runtime 14.16.27012 hf0eaf9b_0 defaults
wincertstore 0.2 py36_1002 conda-forge
xerces-c 3.2.2 h6538335_1004 conda-forge
xz 5.2.4 h2fa13f4_1001 conda-forge
zlib 1.2.11 h2fa13f4_1006 conda-forge
zstd 1.4.0 hd8a0e53_0 conda-forge
Note that I got proj4 6.1.0
while you have 6.1.1
. If I try to force that with conda create --name TEST python=3.6 fiona proj4=6.1.1
I get a proper conflict error :
Package proj4 conflicts for:
fiona -> gdal[version='>=2.4.2,<2.5.0a0'] -> libgdal==2.4.1=h8c2455e_8 -> proj4[version='5.2.0.*|>=5.2.0,<5.2.1.0a0|>=6.1.0,<6.1.1.0a0']
proj4=6.1.1
Note that strict channel priority may have removed packages required for satisfiability.
Note sure how you got that combination. Are you using strict
? Can you share how you build that environment?
conda info with priority set to strict: :
active environment : fake_env
active env location : C:\Users\simon.rhee\AppData\Local\Continuum\anaconda3\envs\fake_env
shell level : 2
user config file : C:\Users\simon.rhee\.condarc
populated config files : C:\Users\simon.rhee\.condarc
conda version : 4.7.11
conda-build version : 3.15.1
python version : 3.7.0.final.0
virtual packages :
base environment : C:\Users\simon.rhee\AppData\Local\Continuum\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/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\simon.rhee\AppData\Local\Continuum\anaconda3\pkgs
C:\Users\simon.rhee\.conda\pkgs
C:\Users\simon.rhee\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\simon.rhee\AppData\Local\Continuum\anaconda3\envs
C:\Users\simon.rhee\.conda\envs
C:\Users\simon.rhee\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.7.11 requests/2.19.1 CPython/3.7.0 Windows/10 Windows/10.0.17134
administrator : False
netrc file : None
offline mode : False
Snippet for installing geopandas which includes fiona and gdal:
conda install -c conda-forge geopandas
Resulting package versions: fiona = 1.8.6 gdal = 2.4.2
Result:
ImportError: DLL load failed: The specified module could not be found
I can reproduce the error:
conda create --name test_gdal python=3.6 fiona rasterio
(test_gdal) PS>python
Python 3.6.7 (default, Jul 2 2019, 02:21:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\whlteXbread\Miniconda3\envs\test_gdal\lib\site-packages\gdal.py", line 2, in <module>
from osgeo.gdal import deprecation_warn
File "C:\Users\whlteXbread\Miniconda3\envs\test_gdal\lib\site-packages\osgeo\__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "C:\Users\whlteXbread\Miniconda3\envs\test_gdal\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "C:\Users\whlteXbread\Miniconda3\envs\test_gdal\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\whlteXbread\Miniconda3\envs\test_gdal\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
>>> import fiona
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\whlteXbread\Miniconda3\envs\test_gdal\lib\site-packages\fiona\__init__.py", line 83, in <module>
from fiona.collection import BytesCollection, Collection
File "C:\Users\whlteXbread\Miniconda3\envs\test_gdal\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.
My .condarc
has conda-forge
in the first spot and defaults
in the second.
conda info:
(base) PS>conda info
active environment : base
active env location : C:\Users\whlteXbread\Miniconda3
shell level : 1
user config file : C:\Users\whlteXbread\.condarc
populated config files : C:\Users\whlteXbread\.condarc
conda version : 4.6.14
conda-build version : not installed
python version : 3.7.3.final.0
base environment : C:\Users\whlteXbread\Miniconda3 (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/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\whlteXbread\Miniconda3\pkgs
C:\Users\whlteXbread\.conda\pkgs
C:\Users\whlteXbread\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\whlteXbread\Miniconda3\envs
C:\Users\whlteXbread\.conda\envs
C:\Users\whlteXbread\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.6.14 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.18362
administrator : False
netrc file : None
offline mode : False
Oddly, I can also reproduce the issue with the command that worked for @ocefpaf above:
conda create --name TEST python=3.6 fiona --yes
I did a diff on the conda list
and the only appreciable difference is that my machine has wheel=0.33.6
and pip=19.2.3
(not listed above) and that in my version packages that come from defaults
don't specifically say defaults
; nothing is listed. Example from my conda list
:
intel-openmp 2019.4 245
Otherwise, they're identical. Which points to...not conda? Except I have previously-built environments that still work just fine.
I had an environment working previously (that still works now) and the only thing I can think of is that I had to install a GDAL_DATA
windows env variable. I tried adjusting that but of course it didn't matter because the GDAL DLLs are not in the GDAL_DATA
dir.
FWIW: I have tried the following:
conda create --name TEST python=3.6 gdal<3 --yes
conda create --name TEST python=3.6 gdal>2.4 --yes
and in both cases I was not able to import gdal
.
Maybe the issue is with GDAL? There are no open issues on their feedstock...what are we missing?
Here is my Windows .condarc
:
show_channel_urls: true
add_pip_as_python_dependency: false
channel_priority: strict
channels:
- conda-forge
- defaults
safety_checks: disabled
auto_update_conda: false
The key here is only strict
and conda-forge on top of defaults
, the rest is nice to have but should not affect the results here.
I'm using a fresh install of miniconda
with conda 4.7.12
and no other Python installation. Just created an environment with conda create -n TEST python=3.6 geopandas
(also tried just fiona
and adding rasterio
to the mix). Everything works as expected and here is the package list:
(TEST) C:\Users\filipe>conda list
# packages in environment at C:\Users\filipe\Miniconda3\envs\TEST:
#
# Name Version Build Channel
attrs 19.1.0 py_0 conda-forge
boost-cpp 1.70.0 h6a4c333_2 conda-forge
bzip2 1.0.8 hfa6e2cd_1 conda-forge
ca-certificates 2019.9.11 hecc5488_0 conda-forge
certifi 2019.9.11 py36_0 conda-forge
cfitsio 3.470 hfa6e2cd_2 conda-forge
click 7.0 py_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.5.0 py_0 conda-forge
curl 7.65.3 h4496350_0 conda-forge
expat 2.2.5 habb2df7_1003 conda-forge
fiona 1.8.6 py36h2979200_4 conda-forge
freetype 2.10.0 h563cfd7_1 conda-forge
freexl 1.0.5 hd288d7e_1002 conda-forge
gdal 2.4.2 py36he6b6c38_4 conda-forge
geopandas 0.5.1 py_0 conda-forge
geos 3.7.2 he025d50_2 conda-forge
geotiff 1.5.1 h8f84788_2 conda-forge
gettext 0.19.8.1 hb01d8f6_1002 conda-forge
glib 2.58.3 hc0c2ac7_1002 conda-forge
hdf4 4.2.13 hf8e6fe8_1002 conda-forge
hdf5 1.10.5 nompi_ha405e13_1103 conda-forge
icu 64.2 he025d50_1 conda-forge
intel-openmp 2019.4 245 defaults
jpeg 9c hfa6e2cd_1001 conda-forge
kealib 1.4.10 hf7dc31f_1005 conda-forge
krb5 1.16.3 hdd46e55_1001 conda-forge
libblas 3.8.0 12_mkl conda-forge
libcblas 3.8.0 12_mkl conda-forge
libcurl 7.65.3 h4496350_0 conda-forge
libffi 3.2.1 h6538335_1006 conda-forge
libgdal 2.4.2 h2bdb96c_4 conda-forge
libiconv 1.15 hfa6e2cd_1005 conda-forge
libkml 1.3.0 h4ece8bf_1010 conda-forge
liblapack 3.8.0 12_mkl conda-forge
libnetcdf 4.6.2 h376842a_1003 conda-forge
libpng 1.6.37 h7602738_0 conda-forge
libpq 11.5 hb0bdaea_1 conda-forge
libspatialindex 1.8.5 he025d50_4 conda-forge
libspatialite 4.3.0a h832c139_1029 conda-forge
libssh2 1.8.2 h642c060_2 conda-forge
libtiff 4.0.10 h6512ee2_1003 conda-forge
libxml2 2.9.9 h9ce36c8_5 conda-forge
lz4-c 1.8.3 he025d50_1001 conda-forge
m2w64-expat 2.1.1 2 defaults
m2w64-gcc-libgfortran 5.3.0 6 defaults
m2w64-gcc-libs 5.3.0 7 defaults
m2w64-gcc-libs-core 5.3.0 7 defaults
m2w64-gettext 0.19.7 2 defaults
m2w64-gmp 6.1.0 2 defaults
m2w64-libiconv 1.14 6 defaults
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 defaults
m2w64-xz 5.2.2 2 defaults
mkl 2019.4 245 defaults
msys2-conda-epoch 20160418 1 defaults
munch 2.3.2 py_0 conda-forge
numpy 1.17.2 py36hc71023c_0 conda-forge
openjpeg 2.3.1 hb24c2e3_1 conda-forge
openssl 1.1.1c hfa6e2cd_0 conda-forge
pandas 0.25.1 py36he350917_0 conda-forge
pcre 8.41 h6538335_1003 conda-forge
poppler 0.67.0 h92819f6_7 conda-forge
poppler-data 0.4.9 1 conda-forge
postgresql 11.5 h06f7779_1 conda-forge
proj4 6.1.0 hc2d0af5_2 conda-forge
pyproj 2.2.1 py36h3f740ce_0 conda-forge
python 3.6.7 he025d50_1005 conda-forge
python-dateutil 2.8.0 py_0 conda-forge
pytz 2019.2 py_0 conda-forge
rtree 0.8.3 py36h21ff451_1002 conda-forge
setuptools 41.2.0 py36_0 conda-forge
shapely 1.6.4 py36ha35856d_1006 conda-forge
six 1.12.0 py36_1000 conda-forge
sqlite 3.29.0 hfa6e2cd_1 conda-forge
tk 8.6.9 hfa6e2cd_1003 conda-forge
vc 14.1 h0510ff6_4 defaults
vs2015_runtime 14.16.27012 hf0eaf9b_0 defaults
wincertstore 0.2 py36_1002 conda-forge
xerces-c 3.2.2 h6538335_1004 conda-forge
xz 5.2.4 h2fa13f4_1001 conda-forge
zlib 1.2.11 h2fa13f4_1006 conda-forge
zstd 1.4.0 hd8a0e53_0 conda-forge
Note the key packages combination that the channel order and strict
configuration gave me:
geos-3.7.2-he025d50_2
, proj4-6.1.0-hc2d0af5_2
, gdal-2.4.2-py36he6b6c38_4
, and libgdal-2.4.2-h2bdb96c_4
.
If you get something different from that while using the same .condarc
, either conda
is making a mistake when solving your env and updating it may help, or we have a package with bad metadata somewhere. The latter is unlikely b/c I cannot reproduce the error.
If you have a different channel configuration there is nothing we can do b/c conda-forge
is only guaranteed to work with strict
and being the higher priority channel. See https://conda-forge.org/docs/user/introduction.html#how-can-i-install-packages-from-conda-forge for more info on that.
I did a diff on the conda list and the only appreciable difference
@wholmgren please post the full conda list
not sure if you considered the build number and hash "appreciable difference."
Thank you for going through all that @ocefpaf .
It was me that posted the comment about the diff, and I literally did an actual diff. all the sources and versions were exactly the same.
Looks like geos
put out an updated build _2
vs. _1
and that seems to have fixed things.
Thank you, though, for pointing out the strict
option in the .condarc
---I had just been manually removing defaults
to get everything to build.
I had just been manually removing defaults to get everything to build
That used to be the recommended way to use conda-forge but since conda 4.6 the strict option was added to the improve the situation.
@whlteXbread I'm also encountering the same ImportError issue with gdal and fiona. Used the .condarc settings @ocefpaf posted.
Issue was reproduced with a fresh install of Miniconda in a clean Windows 10 VM (i.e. Windows Sandbox). Here's my package list:
(test) C:\Users\WDAGUtilityAccount>conda list
# packages in environment at C:\ProgramData\Miniconda3\envs\test:
#
# Name Version Build Channel
attrs 19.3.0 py_0 conda-forge
boost-cpp 1.70.0 h6a4c333_2 conda-forge
bzip2 1.0.8 hfa6e2cd_1 conda-forge
ca-certificates 2019.9.11 hecc5488_0 conda-forge
certifi 2019.9.11 py36_0 conda-forge
cfitsio 3.470 hfa6e2cd_2 conda-forge
click 7.0 py_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.5.0 py_0 conda-forge
curl 7.65.3 h4496350_0 conda-forge
expat 2.2.5 he025d50_1004 conda-forge
fiona 1.8.7 py36h3234bc7_0 conda-forge
freetype 2.10.0 h563cfd7_1 conda-forge
freexl 1.0.5 hd288d7e_1002 conda-forge
gdal 2.4.2 py36he6b6c38_4 conda-forge
geopandas 0.6.1 py_0 conda-forge
geos 3.7.2 he025d50_2 conda-forge
geotiff 1.5.1 h8f84788_2 conda-forge
gettext 0.19.8.1 hb01d8f6_1002 conda-forge
glib 2.58.3 hc0c2ac7_1002 conda-forge
hdf4 4.2.13 hf8e6fe8_1002 conda-forge
hdf5 1.10.5 nompi_ha405e13_1103 conda-forge
icu 64.2 he025d50_1 conda-forge
intel-openmp 2019.4 245 defaults
jpeg 9c hfa6e2cd_1001 conda-forge
kealib 1.4.10 hf7dc31f_1005 conda-forge
krb5 1.16.3 hdd46e55_1001 conda-forge
libblas 3.8.0 14_mkl conda-forge
libcblas 3.8.0 14_mkl conda-forge
libcurl 7.65.3 h4496350_0 conda-forge
libffi 3.2.1 h6538335_1006 conda-forge
libgdal 2.4.2 h2bdb96c_4 conda-forge
libiconv 1.15 hfa6e2cd_1005 conda-forge
libkml 1.3.0 h4ece8bf_1010 conda-forge
liblapack 3.8.0 14_mkl conda-forge
libnetcdf 4.6.2 h376842a_1003 conda-forge
libpng 1.6.37 h7602738_0 conda-forge
libpq 11.5 hb0bdaea_1 conda-forge
libspatialindex 1.8.5 he025d50_4 conda-forge
libspatialite 4.3.0a h832c139_1029 conda-forge
libssh2 1.8.2 h642c060_2 conda-forge
libtiff 4.0.10 h2e92f26_1004 conda-forge
libxml2 2.9.9 h9ce36c8_5 conda-forge
lz4-c 1.8.3 he025d50_1001 conda-forge
m2w64-expat 2.1.1 2 defaults
m2w64-gcc-libgfortran 5.3.0 6 defaults
m2w64-gcc-libs 5.3.0 7 defaults
m2w64-gcc-libs-core 5.3.0 7 defaults
m2w64-gettext 0.19.7 2 defaults
m2w64-gmp 6.1.0 2 defaults
m2w64-libiconv 1.14 6 defaults
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 defaults
m2w64-xz 5.2.2 2 defaults
mkl 2019.4 245 defaults
msys2-conda-epoch 20160418 1 defaults
munch 2.3.2 py_0 conda-forge
numpy 1.17.2 py36hc71023c_0 conda-forge
openjpeg 2.3.1 hb24c2e3_1 conda-forge
openssl 1.1.1c hfa6e2cd_0 conda-forge
pandas 0.25.1 py36he350917_0 conda-forge
pcre 8.43 h6538335_0 conda-forge
poppler 0.67.0 h92819f6_7 conda-forge
poppler-data 0.4.9 1 conda-forge
postgresql 11.5 h06f7779_1 conda-forge
proj4 6.1.0 hc2d0af5_2 conda-forge
pyproj 2.2.1 py36h3f740ce_0 conda-forge
python 3.6.7 he025d50_1005 conda-forge
python-dateutil 2.8.0 py_0 conda-forge
pytz 2019.3 py_0 conda-forge
rtree 0.8.3 py36h21ff451_1002 conda-forge
setuptools 41.4.0 py36_0 conda-forge
shapely 1.6.4 py36ha35856d_1006 conda-forge
six 1.12.0 py36_1000 conda-forge
sqlite 3.30.1 hfa6e2cd_0 conda-forge
tk 8.6.9 hfa6e2cd_1003 conda-forge
vc 14.1 h0510ff6_4 defaults
vs2015_runtime 14.16.27012 hf0eaf9b_0 defaults
wincertstore 0.2 py36_1002 conda-forge
xerces-c 3.2.2 h6538335_1004 conda-forge
xz 5.2.4 h2fa13f4_1001 conda-forge
zlib 1.2.11 h2fa13f4_1006 conda-forge
zstd 1.4.3 hd8a0e53_0 conda-forge
Builds for fiona, gdal, geos proj4 and libgdal appear to be the same as what @ocefpaf had...
I have a .condarc file that looks like this: ############ channels:
Results in the following error:
import fiona Traceback (most recent call last): File "
", line 1, in File "C:\Users\mhearne\AppData\Local\Continuum\miniconda3\envs\TEST\lib\site-packages\fiona__init__.py", line 83, in from fiona.collection import BytesCollection, Collection File "C:\Users\mhearne\AppData\Local\Continuum\miniconda3\envs\TEST\lib\site-packages\fiona\collection.py", line 9, in from fiona.ogrext import Iterator, ItemsIterator, KeysIterator ImportError: DLL load failed: The specified module could not be found.
Since I'm having problems on the OSX side too, I'm guessing something larger is going on?
This issue just keeps popping up for me too... My .condarc file is as @ocefpaf described and after a fresh install I still get the dll load failed error after installing fiona.
conda list:
# Name Version Build Channel
attrs 19.3.0 py_0 conda-forge
boost-cpp 1.70.0 h6a4c333_2 conda-forge
bzip2 1.0.8 hfa6e2cd_1 conda-forge
ca-certificates 2019.9.11 hecc5488_0 conda-forge
certifi 2019.9.11 py36_0 conda-forge
cfitsio 3.470 hfa6e2cd_2 conda-forge
click 7.0 py_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.5.0 py_0 conda-forge
curl 7.65.3 h4496350_0 conda-forge
expat 2.2.5 he025d50_1004 conda-forge
fiona 1.8.7 py36h3234bc7_0 conda-forge
freetype 2.10.0 h563cfd7_1 conda-forge
freexl 1.0.5 hd288d7e_1002 conda-forge
gdal 2.4.2 py36he6b6c38_4 conda-forge
geos 3.7.2 he025d50_2 conda-forge
geotiff 1.5.1 h8f84788_2 conda-forge
gettext 0.19.8.1 hb01d8f6_1002 conda-forge
glib 2.58.3 hc0c2ac7_1002 conda-forge
hdf4 4.2.13 hf8e6fe8_1002 conda-forge
hdf5 1.10.5 nompi_ha405e13_1103 conda-forge
icu 64.2 he025d50_1 conda-forge
intel-openmp 2019.4 245
jpeg 9c hfa6e2cd_1001 conda-forge
kealib 1.4.10 hf7dc31f_1005 conda-forge
krb5 1.16.3 hdd46e55_1001 conda-forge
libblas 3.8.0 14_mkl conda-forge
libcblas 3.8.0 14_mkl conda-forge
libcurl 7.65.3 h4496350_0 conda-forge
libffi 3.2.1 h6538335_1006 conda-forge
libgdal 2.4.2 h2bdb96c_4 conda-forge
libiconv 1.15 hfa6e2cd_1005 conda-forge
libkml 1.3.0 h4ece8bf_1010 conda-forge
liblapack 3.8.0 14_mkl conda-forge
libnetcdf 4.6.2 h376842a_1003 conda-forge
libpng 1.6.37 h7602738_0 conda-forge
libpq 11.5 hb0bdaea_1 conda-forge
libspatialite 4.3.0a h832c139_1029 conda-forge
libssh2 1.8.2 h642c060_2 conda-forge
libtiff 4.0.10 h2e92f26_1004 conda-forge
libxml2 2.9.9 h9ce36c8_5 conda-forge
lz4-c 1.8.3 he025d50_1001 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.4 245
msys2-conda-epoch 20160418 1
munch 2.3.2 py_0 conda-forge
numpy 1.17.2 py36hc71023c_0 conda-forge
openjpeg 2.3.1 hb24c2e3_1 conda-forge
openssl 1.1.1c hfa6e2cd_0 conda-forge
pcre 8.43 h6538335_0 conda-forge
pip 19.3.1 py36_0 conda-forge
poppler 0.67.0 h92819f6_7 conda-forge
poppler-data 0.4.9 1 conda-forge
postgresql 11.5 h06f7779_1 conda-forge
proj4 6.1.0 hc2d0af5_2 conda-forge
python 3.6.7 he025d50_1005 conda-forge
setuptools 41.4.0 py36_0 conda-forge
shapely 1.6.4 py36ha35856d_1006 conda-forge
six 1.12.0 py36_1000 conda-forge
sqlite 3.30.1 hfa6e2cd_0 conda-forge
tk 8.6.9 hfa6e2cd_1003 conda-forge
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_0
wheel 0.33.6 py36_0 conda-forge
wincertstore 0.2 py36_1002 conda-forge
xerces-c 3.2.2 h6538335_1004 conda-forge
xz 5.2.4 h2fa13f4_1001 conda-forge
zlib 1.2.11 h2fa13f4_1006 conda-forge
zstd 1.4.3 hd8a0e53_0 conda-forge
conda config stuff:
channel_priority: strict
channels:
- conda-forge
- defaults
I got the error after installing geopandas.
(Strangely enough I was getting a similar DLL error with another library pillow
in another environment).
Error:
>>> import fiona
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\envs\dev_37\lib\site-packages\fiona\__init__.py", line 83, in <module>
from fiona.collection import BytesCollection, Collection
File "C:\ProgramData\Anaconda3\envs\dev_37\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.
conda info
active environment : dev_37
active env location : C:\ProgramData\Anaconda3\envs\dev_37
shell level : 1
user config file : C:\Users\XXX\DOCUME~1\MOBAXT~1\home\.condarc
populated config files : C:\Users\XXX\DOCUME~1\MOBAXT~1\home\.condarc
conda version : 4.7.12
conda-build version : 3.18.9
python version : 3.7.4.final.0
virtual packages :
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/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\ProgramData\Anaconda3\pkgs
C:\Users\XXX\DOCUME~1\MOBAXT~1\home\.conda\pkgs
C:\Users\XXX\AppData\Local\conda\conda\pkgs
envs directories : C:\ProgramData\Anaconda3\envs
C:\Users\XXX\DOCUME~1\MOBAXT~1\home\.conda\envs
C:\Users\XXX\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Windows/10 Windows/10.0.16299
administrator : False
netrc file : None
offline mode : False
conda list
# Name Version Build Channel
attrs 19.3.0 py_0 conda-forge
backcall 0.1.0 py_0 conda-forge
bleach 3.1.0 py_0 conda-forge
boost-cpp 1.70.0 h6a4c333_2 conda-forge
bzip2 1.0.8 hfa6e2cd_1 conda-forge
ca-certificates 2019.9.11 hecc5488_0 conda-forge
certifi 2019.6.16 py37_1 conda-forge
cfitsio 3.470 hfa6e2cd_2 conda-forge
click 7.0 py_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.5.0 py_0 conda-forge
colorama 0.4.1 py_0 conda-forge
curl 7.65.3 h4496350_0 conda-forge
cycler 0.10.0 py_1 conda-forge
decorator 4.4.0 py_0 conda-forge
defusedxml 0.6.0 py_0 conda-forge
entrypoints 0.3 py37_1000 conda-forge
expat 2.2.5 he025d50_1004 conda-forge
fiona 1.8.7 py37h3234bc7_0 conda-forge
freetype 2.10.0 h563cfd7_1 conda-forge
freexl 1.0.5 hd288d7e_1002 conda-forge
gdal 2.4.2 py37he6b6c38_4 conda-forge
geopandas 0.6.1 py_0 conda-forge
geos 3.7.2 he025d50_2 conda-forge
geotiff 1.5.1 h8f84788_2 conda-forge
gettext 0.19.8.1 hb01d8f6_1002 conda-forge
glib 2.58.3 hc0c2ac7_1002 conda-forge
hdf4 4.2.13 hf8e6fe8_1002 conda-forge
hdf5 1.10.5 nompi_ha405e13_1104 conda-forge
icu 64.2 he025d50_1 conda-forge
importlib_metadata 0.23 py37_0 conda-forge
intel-openmp 2019.4 245
ipykernel 5.1.3 py37h5ca1d4c_0 conda-forge
ipython 7.8.0 py37h5ca1d4c_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.5.1 py_0 conda-forge
jedi 0.15.1 py37_0 conda-forge
jinja2 2.10.3 py_0 conda-forge
jpeg 9c hfa6e2cd_1001 conda-forge
json5 0.8.5 py_0 conda-forge
jsonschema 3.1.1 py37_0 conda-forge
jupyter 1.0.0 py_2 conda-forge
jupyter_client 5.3.3 py37_1 conda-forge
jupyter_console 6.0.0 py_0 conda-forge
jupyter_core 4.5.0 py_0 conda-forge
jupyterlab 1.1.4 py_0 conda-forge
jupyterlab_server 1.0.6 py_0 conda-forge
kealib 1.4.10 hf7dc31f_1005 conda-forge
kiwisolver 1.1.0 py37he980bc4_0 conda-forge
krb5 1.16.3 hdd46e55_1001 conda-forge
libblas 3.8.0 14_mkl conda-forge
libcblas 3.8.0 14_mkl conda-forge
libclang 9.0.0 h74a9793_1 conda-forge
libcurl 7.65.3 h4496350_0 conda-forge
libffi 3.2.1 h6538335_1006 conda-forge
libgdal 2.4.2 h2bdb96c_4 conda-forge
libiconv 1.15 hfa6e2cd_1005 conda-forge
libkml 1.3.0 h4ece8bf_1010 conda-forge
liblapack 3.8.0 14_mkl conda-forge
libnetcdf 4.6.2 h376842a_1003 conda-forge
libpng 1.6.37 h7602738_0 conda-forge
libpq 11.5 hb0bdaea_1 conda-forge
libsodium 1.0.17 h2fa13f4_0 conda-forge
libspatialindex 1.8.5 he025d50_4 conda-forge
libspatialite 4.3.0a h832c139_1029 conda-forge
libssh2 1.8.2 h642c060_2 conda-forge
libtiff 4.0.10 h2e92f26_1004 conda-forge
libxml2 2.9.9 h9ce36c8_5 conda-forge
lz4-c 1.8.3 he025d50_1001 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
markupsafe 1.1.1 py37hfa6e2cd_0 conda-forge
matplotlib 3.1.1 py37_1 conda-forge
matplotlib-base 3.1.1 py37h2852a4a_1 conda-forge
mistune 0.8.4 py37hfa6e2cd_1000 conda-forge
mkl 2019.4 245
more-itertools 7.2.0 py_0 conda-forge
msys2-conda-epoch 20160418 1
munch 2.3.2 py_0 conda-forge
nbconvert 5.6.0 py37_1 conda-forge
nbformat 4.4.0 py_1 conda-forge
notebook 6.0.1 py37_0 conda-forge
numpy 1.15.4 py37h8078771_1002 conda-forge
openjpeg 2.3.1 hb24c2e3_1 conda-forge
openssl 1.1.1c hfa6e2cd_0 conda-forge
pandas 0.25.2 py37he350917_0 conda-forge
pandoc 2.7.3 0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.5.1 py_0 conda-forge
pcre 8.43 h6538335_0 conda-forge
pickleshare 0.7.5 py37_1000 conda-forge
pip 19.3.1 py37_0 conda-forge
poppler 0.67.0 h92819f6_7 conda-forge
poppler-data 0.4.9 1 conda-forge
postgresql 11.5 h06f7779_1 conda-forge
proj4 6.1.0 hc2d0af5_2 conda-forge
prometheus_client 0.7.1 py_0 conda-forge
prompt_toolkit 2.0.10 py_0 conda-forge
pygments 2.4.2 py_0 conda-forge
pyparsing 2.4.2 py_0 conda-forge
pyproj 2.2.1 py37h3f740ce_0 conda-forge
pyqt 5.12.3 py37h6538335_0 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.15.4 py37hfa6e2cd_0 conda-forge
python 3.7.3 h510b542_1 conda-forge
python-dateutil 2.8.0 py_0 conda-forge
pytz 2019.3 py_0 conda-forge
pywin32 224 py37hfa6e2cd_1000 conda-forge
pywinpty 0.5.5 py37_1000 conda-forge
pyzmq 18.1.0 py37h16f9016_0 conda-forge
qt 5.12.5 h7ef1ec2_0 conda-forge
qtconsole 4.5.5 py_0 conda-forge
rtree 0.8.3 py37h21ff451_1002 conda-forge
send2trash 1.5.0 py_0 conda-forge
setuptools 41.4.0 py37_0 conda-forge
shapely 1.6.4 py37ha35856d_1006 conda-forge
six 1.12.0 py37_1000 conda-forge
sqlite 3.30.1 hfa6e2cd_0 conda-forge
terminado 0.8.2 py37_0 conda-forge
testpath 0.4.2 py_1001 conda-forge
tk 8.6.9 hfa6e2cd_1003 conda-forge
tornado 6.0.3 py37hfa6e2cd_0 conda-forge
traitlets 4.3.3 py37_0 conda-forge
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_0
wcwidth 0.1.7 py_1 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.33.6 py37_0 conda-forge
widgetsnbextension 3.5.1 py37_0 conda-forge
wincertstore 0.2 py37_1002 conda-forge
winpty 0.4.3 4 conda-forge
xerces-c 3.2.2 h6538335_1004 conda-forge
xz 5.2.4 h2fa13f4_1001 conda-forge
zeromq 4.3.2 h6538335_2 conda-forge
zipp 0.6.0 py_0 conda-forge
zlib 1.2.11 h2fa13f4_1006 conda-forge
zstd 1.4.3 hd8a0e53_0 conda-forge
I tries downgrading fiona to 1.8.6 and 1.8.5 ... no dice. Starting to think this might be an Anaconda broken path setting.
Note that there are multiple issues here. @mhearne-usgs if you want to follow up on your macOS issue can you open a new one with the debug info?
This issue was "kind of" narrowing down to "I-cannot-reproduce-the-Windows failure-in-my-Windows-machine." For those who have the exact same configuration I have and the exact same packages that means something else may be interfering with the libraries that gdal
is loading. Maybe a local installation of some of them?
Not sure if it's useful information, but I created a new env on the same machine without the conda-forge channel (i.e. just the normal defaults channel), and fiona loaded fine.
Not sure if it's useful information, but I created a new env on the same machine without the conda-forge channel (i.e. just the normal defaults channel), and fiona loaded fine.
It is useful b/c we can rule out our case as a channel mix problem. B/c I don't have your debug information I confirm that but I'm pretty sure your config before was pulling from mixed channels.
My colleague has the same problem with the install of gdelt and fiona. My environments dont have this problem. Fiona will be installed and imported correctly every time. Both systems are Windows.
We found some curios behaviour that maybe points to the problem.
We created 3 environments (conda create --name XXX python=3.6): Channel conda-forge is set in .condarc as first entry with _channelpriority: strict
First environment:
Second environment:
Third environment:
Install over defaults channel works too.
Update Narrowed down to dependency libtiff (?) libtiff 4.0.10-h2e92f26_1004 -> doesnt work manually downgrade to: libtiff 4.0.10-h6512ee2_1003 -> fiona import works
zstd will be downgraded with the libtiff build 1.4.3-hd8a0e53_0 --> 1.4.0-hd8a0e53_0
@BroodWyrm are those tests all on Windows?
@BroodWyrm are those tests all on Windows?
yes all on windows
I'm not 100% sure what is the problem with libtiff 4.0.10-h2e92f26_1004
but I moved it to broken to fix Windows installations under some those solutions that are pulling it. Let me know if that solves it for you (it may take ~1 hour for the CDN to sync).
Also, there will be a new fiona
with gdal 3.0.1
soon, see #146.
Closing this to avoid confusing. Anyone that still experience problems with fiona please open new issues with the required debug info to help us solve this. Note that the error in the title here is a generic problem and many different issues may lead to it.
Thanks @ocefpaf , will try again in the near-future and will report back the results.
Thanks @ocefpaf, I can confirm that import works without issue with the new fiona
with gdal 3.0.1
.
This happened again on Win64 with fiona 1.8.11 + libtiff 4.1.0 and I solved by downgrading libtiff to 4.0.10
apparently fiona 1.8.11 + libtiff 4.1.0 are not a problem on linux64
This happened again on Win64 with fiona 1.8.11 + libtiff 4.1.0 and I solved by downgrading libtiff to 4.0.10
apparently fiona 1.8.11 + libtiff 4.1.0 are not a problem on linux64
Please always open a new issue b/c the symptoms may look the same but the problem is most of the time different. Also, https://github.com/conda-forge/gdal-feedstock/pull/352 should solve it.
I have this exact problem, and it seem to be an issue with geopanda
...
$ python -c "from osgeo import gdal"
$ python -c "import fiona; print(fiona.__version__)"
1.8.13
$ fio.exe env
ARCGEN (modes 'r')
AeronavFAA (modes 'r')
BNA (modes 'r', 'a', 'w')
CSV (modes 'r', 'a', 'w')
DGN (modes 'r', 'a', 'w')
DXF (modes 'r', 'a', 'w')
ESRI Shapefile (modes 'r', 'a', 'w')
ESRIJSON (modes 'r')
GML (modes 'r', 'a', 'w')
GPKG (modes 'r', 'w')
GPSTrackMaker (modes 'r', 'a', 'w')
GPX (modes 'r', 'a', 'w')
GeoJSON (modes 'r', 'w')
GeoJSONSeq (modes 'r', 'w')
Idrisi (modes 'r')
MapInfo File (modes 'r', 'a', 'w')
OpenFileGDB (modes 'r')
PCIDSK (modes 'r')
S57 (modes 'r')
SEGY (modes 'r')
SUA (modes 'r')
TopoJSON (modes 'r')
$ python -c "import geopandas"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Python37\lib\site-packages\geopandas\__init__.py", line 5, in <module>
from geopandas.io.file import read_file # noqa
File "C:\Python37\lib\site-packages\geopandas\io\file.py", line 6, in <module>
import fiona
File "C:\Python37\lib\site-packages\fiona\__init__.py", line 87, in <module>
from fiona.collection import BytesCollection, Collection
File "C:\Python37\lib\site-packages\fiona\collection.py", line 9, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The specified procedure could not be found.
after having set:
[System.Environment]::SetEnvironmentVariable("GDAL_DATA", "C:\Program Files\GDAL\gdal-data", "Machine")
[System.Environment]::SetEnvironmentVariable("GDAL_DRIVER_PATH", "C:\Program Files\GDAL\gdalplugins", "Machine")
[System.Environment]::SetEnvironmentVariable("GDAL_VERSION", "3.0.4", "Machine")
[System.Environment]::SetEnvironmentVariable("PROJ_LIB", "C:\Program Files\GDAL\projlib", "Machine")
Please open a new issue and fill the required information. The problem may seems the same but without the proper debug info we cannot help you.
Issue:
I have an issue that is similar to the issue here: https://github.com/Toblerity/Fiona/issues/402
I get ImportError: DLL load failed: The specified module could not be found.
The specific traceback shows that the error comes from
import fiona
from fiona.collection import BytesCollection, Collection
Environment (
conda list
):Details about
conda
and system (conda info
):