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
GDAL import error #248
Comments
@ocefpaf are we still supporting Python 3.5? |
I'm running python 3.5.5 in that test env, Python 3.5.5 | packaged by conda-forge | (default, Jul 24 2018, 01:52:17) [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:\Anaconda3\envs\GDAL\lib\site-packages\gdal.py", line 2, in <module>
from osgeo.gdal import deprecation_warn
File "C:\Anaconda3\envs\GDAL\lib\site-packages\osgeo\__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "C:\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:\Anaconda3\envs\GDAL\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Anaconda3\envs\GDAL\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found. Python 3.7.1 | packaged by conda-forge | (default, Nov 13 2018, 19:01:41) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. 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:\Anaconda3\lib\site-packages\gdal.py", line 2, in <module>
from osgeo.gdal import deprecation_warn
File "C:\Anaconda3\lib\site-packages\osgeo\__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "C:\Anaconda3\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "C:\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
>>> |
As mentioned in the related anaconda issue, please use python 3.6 or above. Conda-forge no longer supports python 3.5. |
I have solved the problem - an incompatibility between GDAL and a runtime library. The solution was found here https://gis.stackexchange.com/questions/294231/installing-gdal-with-anaconda?rq=1
Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 11:48:23) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
>>> |
Hi @djhoese - actually the problem exists in versions of python 3.6 (see my edited post, above) |
When doing these commands what version of gdal gets installed? My guess would be that an older version of gdal is installed (built with an older compiler). |
@djhoese - first, thanks for your input with this! In all cases (ie, the three environments I show above) it is gdal 2.3.2 that is installed Can you suggest what's happening, in term of conda package management? |
First, you want to make sure that all of the gdal related packages are coming from Second, the main issue most likely based on the last two weeks is that the libtiff package in anaconda and on conda-forge has stopped copying the What happens if you take the broken environment and try |
@djhoese I've had a go at Computer 1 had a python env using only default channels. I added conda-forge with highest priority, installed hdf5=1.10.4, and Gdal now works! Computer 2 already had hdf5 = 1.10.3 installed. Conda wouldn't automagically downgrade relevant packages when trying to update hdf5 to 1.10.4 and resulted in this conda error: (base) C:\Users\User>conda install hdf5=1.10.4
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- hdf5=1.10.4
- pytables
- python=3.7
Use "conda info <package>" to see the dependencies for each package. |
We don't support 3.5 but it seems that the problem exists on 3.6 too. @ThirstyGeo unfortunately on Windows we cannot afford to remove conda update conda --yes
conda create --name TEST python=3.7 gdal --yes
conda activate TEST
python -c "import gdal; print(dir(gdal))" And if that does not work please send us the results of:
and
|
@ocefpaf Yes: |
If you try with Python 3.6 please let me know how it goes. (I don't have Windows to test this things.) |
I have just tried with Python 3.6 — gdal loads properly. Using the following: |
Thanks for testing it out! |
Issue:
The following import, detailed below, fails.
This may be a duplicate of https://github.com/conda-forge/gdal-feedstock/issues/219
Previous fixes for this issue don't apply:
Environment (
conda list
):Details about
conda
and system (conda info
):populated config files : C:\Users\User.condarc
conda version : 4.5.11
conda-build version : 3.15.1
python version : 3.7.1.final.0
base environment : C:\Anaconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/anaconda-fusion/win-64
https://conda.anaconda.org/anaconda-fusion/noarch
https://conda.anaconda.org/r/win-64
https://conda.anaconda.org/r/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:\Anaconda3\pkgs
C:\Users\User\AppData\Local\conda\conda\pkgs
envs directories : C:\Anaconda3\envs
C:\Users\User\AppData\Local\conda\conda\envs
C:\Users\User.conda\envs
platform : win-64
user-agent : conda/4.5.11 requests/2.19.1 CPython/3.7.1 Windows/10 Windows/10.0.17134
administrator : False
netrc file : None
offline mode : False
The text was updated successfully, but these errors were encountered: