Topics

installing Fiona and conflicting instillation information for Windows


Eyal Saiet
 

Hello,
I have had rasterio for a while, and thought installing fiona would be equality simple, I was wrong. As of now gdal runs fine in the command line, but  from osgeo import gdal

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-61e0eefce4de> in <module>
----> 1 from osgeo import gdal

ImportError: cannot import name 'gdal' from 'osgeo' (c:\users\est\appdata\local\programs\python\python37\lib\site-packages\osgeo\__init__.py)

Reading conflicting information across the web I am confused what variables and paths should I have my system variable. I have seen
GDAL_DATA=C:\Users\est\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\data\gdal
As well:
GDAL_DATA=C:\Program Files\GDAL\gdal-data
So  I guess I have gdal installed as a program as well a in the gdal wheel
         pip install GDAL-3.1.2-cp37-cp37m-win_amd64.whl
         pip install rasterio-1.1.5-cp37-cp37m-win_amd64.whl
According to the offical instalation documentation I should add C:\Program Files\GDAL\gdal-datato the Path variable in the System Variable as well gdal300.dll I have done that.

I am trying to install the fiona from the downloaded wheel from link
C:\Users\esaiet\Downloads>pip install Fiona-1.8.17-cp37-cp37m-win_amd64.whl
Processing c:\users\esaiet\downloads\fiona-1.8.17-cp37-cp37m-win_amd64.whl
Requirement already satisfied: click>=4.0 in c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages (from Fiona==1.8.17) (7.0)
Requirement already satisfied: cligj>=0.5 in c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages (from Fiona==1.8.17) (0.5.0)
Requirement already satisfied: attrs>=17 in c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages (from Fiona==1.8.17) (19.3.0)
Requirement already satisfied: munch in c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages (from Fiona==1.8.17) (2.5.0)
Requirement already satisfied: six>=1.7 in c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages (from Fiona==1.8.17) (1.13.0)
Requirement already satisfied: click-plugins>=1.0 in c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages (from Fiona==1.8.17) (1.1.1)
Collecting gdal~=3.1.2
  Using cached GDAL-3.1.4.tar.gz (593 kB)
Using legacy 'setup.py install' for gdal, since package 'wheel' is not installed.
Installing collected packages: gdal, Fiona
  Attempting uninstall: gdal
    Found existing installation: gdal 3.0.2
    Uninstalling gdal-3.0.2:
      Successfully uninstalled gdal-3.0.2
    Running setup.py install for gdal ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\esaiet\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\esaiet\\AppData\\Local\\Temp\\pip-install-xf4x5ja5\\gdal\\setup.py'"'"'; __file__='"'"'C:\\Users\\esaiet\\AppData\\Local\\Temp\\pip-install-xf4x5ja5\\gdal\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\esaiet\AppData\Local\Temp\pip-record-6q_z7sht\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\esaiet\appdata\local\programs\python\python37\Include\gdal'
         cwd: C:\Users\esaiet\AppData\Local\Temp\pip-install-xf4x5ja5\gdal\
    Complete output (52 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    copying gdal.py -> build\lib.win-amd64-3.7
    copying ogr.py -> build\lib.win-amd64-3.7
    copying osr.py -> build\lib.win-amd64-3.7
    copying gdalconst.py -> build\lib.win-amd64-3.7
    copying gdalnumeric.py -> build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\osgeo
    copying osgeo\gdal.py -> build\lib.win-amd64-3.7\osgeo
    copying osgeo\gdalconst.py -> build\lib.win-amd64-3.7\osgeo
    copying osgeo\gdalnumeric.py -> build\lib.win-amd64-3.7\osgeo
    copying osgeo\gdal_array.py -> build\lib.win-amd64-3.7\osgeo
    copying osgeo\gnm.py -> build\lib.win-amd64-3.7\osgeo
    copying osgeo\ogr.py -> build\lib.win-amd64-3.7\osgeo
    copying osgeo\osr.py -> build\lib.win-amd64-3.7\osgeo
    copying osgeo\__init__.py -> build\lib.win-amd64-3.7\osgeo
    Fixing build\lib.win-amd64-3.7\gdal.py build\lib.win-amd64-3.7\ogr.py build\lib.win-amd64-3.7\osr.py build\lib.win-amd64-3.7\gdalconst.py build\lib.win-amd64-3.7\gdalnumeric.py build\lib.win-amd64-3.7\osgeo\gdal.py build\lib.win-amd64-3.7\osgeo\gdalconst.py build\lib.win-amd64-3.7\osgeo\gdalnumeric.py build\lib.win-amd64-3.7\osgeo\gdal_array.py build\lib.win-amd64-3.7\osgeo\gnm.py build\lib.win-amd64-3.7\osgeo\ogr.py build\lib.win-amd64-3.7\osgeo\osr.py build\lib.win-amd64-3.7\osgeo\__init__.py
    Skipping optional fixer: ws_comma
    Fixing build\lib.win-amd64-3.7\gdal.py build\lib.win-amd64-3.7\ogr.py build\lib.win-amd64-3.7\osr.py build\lib.win-amd64-3.7\gdalconst.py build\lib.win-amd64-3.7\gdalnumeric.py build\lib.win-amd64-3.7\osgeo\gdal.py build\lib.win-amd64-3.7\osgeo\gdalconst.py build\lib.win-amd64-3.7\osgeo\gdalnumeric.py build\lib.win-amd64-3.7\osgeo\gdal_array.py build\lib.win-amd64-3.7\osgeo\gnm.py build\lib.win-amd64-3.7\osgeo\ogr.py build\lib.win-amd64-3.7\osgeo\osr.py build\lib.win-amd64-3.7\osgeo\__init__.py
    Skipping optional fixer: ws_comma
    running build_ext
    building 'osgeo._gdal' extension
    building 'osgeo._gdalconst' extension
    building 'osgeo._osr' extension
    building 'osgeo._ogr' extension
    building 'osgeo._gnm' extension
    building 'osgeo._gdal_array' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\extensions
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpextensions/osr_wrap.cpp /Fobuild\temp.win-amd64-3.7\Release\extensions/osr_wrap.obj
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpextensions/gnm_wrap.cpp /Fobuild\temp.win-amd64-3.7\Release\extensions/gnm_wrap.obj
    osr_wrap.cpp
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcextensions/gdalconst_wrap.c /Fobuild\temp.win-amd64-3.7\Release\extensions/gdalconst_wrap.obj
    gnm_wrap.cpp
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpextensions/ogr_wrap.cpp /Fobuild\temp.win-amd64-3.7\Release\extensions/ogr_wrap.obj
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpextensions/gdal_array_wrap.cpp /Fobuild\temp.win-amd64-3.7\Release\extensions/gdal_array_wrap.obj
    gdalconst_wrap.c
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\include -Ic:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpextensions/gdal_wrap.cpp /Fobuild\temp.win-amd64-3.7\Release\extensions/gdal_wrap.obj
    ogr_wrap.cpp
    gdal_array_wrap.cpp
    gdal_wrap.cpp
    extensions/gdalconst_wrap.c(3018): fatal error C1083: Cannot open include file: 'gdal.h': No such file or directory
    extensions/gdal_array_wrap.cpp(3144): fatal error C1083: Cannot open include file: 'gdal.h': No such file or directory
    extensions/osr_wrap.cpp(3198): fatal error C1083: Cannot open include file: 'cpl_string.h': No such file or directory
    extensions/gnm_wrap.cpp(3135): fatal error C1083: Cannot open include file: 'gdal.h': No such file or directory
    extensions/ogr_wrap.cpp(3149): fatal error C1083: Cannot open include file: 'gdal.h': No such file or directory
    extensions/gdal_wrap.cpp(3189): fatal error C1083: Cannot open include file: 'cpl_port.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
  Rolling back uninstall of gdal
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\gdal-3.0.2.dist-info\
   from c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\~dal-3.0.2.dist-info
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\osgeo\
   from c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\~-geo
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\lib\site-packages\osr.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-g4nk5v0p\osr.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\epsg_tr.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\epsg_tr.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\esri2wkt.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\esri2wkt.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gcps2vec.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gcps2vec.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gcps2wld.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gcps2wld.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal2tiles.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal2tiles.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal2xyz.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal2xyz.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_auth.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_auth.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_calc.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_calc.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_edit.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_edit.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_fillnodata.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_fillnodata.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_merge.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_merge.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_pansharpen.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_pansharpen.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_polygonize.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_polygonize.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_proximity.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_proximity.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_retile.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_retile.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdal_sieve.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdal_sieve.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdalchksum.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdalchksum.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdalcompare.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdalcompare.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdalident.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdalident.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdalimport.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdalimport.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\gdalmove.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\gdalmove.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\mkgraticule.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\mkgraticule.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\ogrmerge.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\ogrmerge.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\pct2rgb.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\pct2rgb.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\__pycache__\rgb2pct.cpython-37.pyc
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-oc7aaljf\rgb2pct.cpython-37.pyc
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\epsg_tr.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\epsg_tr.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\esri2wkt.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\esri2wkt.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gcps2vec.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gcps2vec.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gcps2wld.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gcps2wld.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal2tiles.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal2tiles.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal2xyz.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal2xyz.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_auth.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_auth.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_calc.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_calc.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_edit.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_edit.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_fillnodata.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_fillnodata.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_merge.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_merge.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_pansharpen.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_pansharpen.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_polygonize.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_polygonize.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_proximity.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_proximity.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_retile.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_retile.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdal_sieve.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdal_sieve.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdalchksum.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdalchksum.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdalcompare.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdalcompare.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdalident.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdalident.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdalimport.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdalimport.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\gdalmove.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\gdalmove.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\mkgraticule.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\mkgraticule.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\ogrmerge.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\ogrmerge.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\pct2rgb.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\pct2rgb.py
  Moving to c:\users\esaiet\appdata\local\programs\python\python37\scripts\rgb2pct.py
   from C:\Users\esaiet\AppData\Local\Temp\pip-uninstall-547oer88\rgb2pct.py
ERROR: Command errored out with exit status 1: 'c:\users\esaiet\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\esaiet\\AppData\\Local\\Temp\\pip-install-xf4x5ja5\\gdal\\setup.py'"'"'; __file__='"'"'C:\\Users\\esaiet\\AppData\\Local\\Temp\\pip-install-xf4x5ja5\\gdal\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\esaiet\AppData\Local\Temp\pip-record-6q_z7sht\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\esaiet\appdata\local\programs\python\python37\Include\gdal' Check the logs for full command output.



Thanks Eyal


René Buffat
 

The wheels from https://www.lfd.uci.edu/~gohlke/pythonlibs/ are not created by the Fiona project and thus we can no support them here.

In general, the install instructions from this site should be followed.  E.g. regarding Visual C++ Redistributable, package dependencies etc. If e.g., it says that a package requires a dependency, this dependency should be installed before. With gohlke's wheels, both the rasterio and fiona packages require the gdal package (this is not the case for the wheels provided by the Fiona project over pypi). Make sure that the packages are installed simultaneously. E.g. if fiona should be updated, it is very likely that also the gdal package must be updated beforehand (respectively all other packages that depend on the gdal package). 


Eyal Saiet
 

Hello Rene,
thanks for responding to my post. The required packages were installed prior to the Fiona installation attempt. I have used gohlk's wheels sucecffuley many times installing the rasterio. My guess is I am lost on what the path and other variables should be.  But also the setup.py in the wheel is having trouble.

I just discovered for the first time  (thanks to your link) that there are official Fiona wheels, but none are for Windows.

Can you explain to me the logic of the path variables and if needed what other variables do I need to setup in the Environment Variable?





On Sat, Nov 21, 2020 at 12:46 PM René Buffat <buffat@...> wrote:
The wheels from https://www.lfd.uci.edu/~gohlke/pythonlibs/ are not created by the Fiona project and thus we can no support them here.

In general, the install instructions from this site should be followed.  E.g. regarding Visual C++ Redistributable, package dependencies etc. If e.g., it says that a package requires a dependency, this dependency should be installed before. With gohlke's wheels, both the rasterio and fiona packages require the gdal package (this is not the case for the wheels provided by the Fiona project over pypi). Make sure that the packages are installed simultaneously. E.g. if fiona should be updated, it is very likely that also the gdal package must be updated beforehand (respectively all other packages that depend on the gdal package). 



--


Eyal Saiet

Project manager
Remote sensing and in-situ measurements

Geophysical Institute 
University of Alaska Fairbanks
Fairbanks, AK 99775
(907) 750 6555 (cell)



The mind is not a vessel to be filled, but a fire to be kindled. Plutarch


René Buffat
 

I have to say it is a long time ago since I used these wheels on Windows. From what I remember there was no need to set any paths. However, it was important to install all the necessary dependencies (MS C++ redistributable, pip, numpy, gdal etc.). But this could have changed. 

An alternative would be to use conda. The benefit of using conda is that you can install packages over an index and you don't have to install them manually. Fiona is available in conda-forge: https://github.com/conda-forge/fiona-feedstock However, I never used conda on Windows, thus I can't say too much about it. 


Simon Norris
 

I have used conda on windows - it makes gdal/fiona/rasterio/geopandas installation much easier:

conda create -n myenv
conda activate myenv
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install gdal
conda install fiona
conda install rasterio

On Nov 25, 2020, at 12:12 PM, René Buffat <buffat@...> wrote:

I have to say it is a long time ago since I used these wheels on Windows. From what I remember there was no need to set any paths. However, it was important to install all the necessary dependencies (MS C++ redistributable, pip, numpy, gdal etc.). But this could have changed. 

An alternative would be to use conda. The benefit of using conda is that you can install packages over an index and you don't have to install them manually. Fiona is available in conda-forge: https://github.com/conda-forge/fiona-feedstock However, I never used conda on Windows, thus I can't say too much about it. 


Eyal Saiet
 

I uninstalled and reinstalled  osgeo/gdal , rasterio, and fiona. This time I did not get any installation error. But get a dll error when trying to import fiona.
Previously I installed all the required dependencies.
As well added to User Enviroment Variables
Path= C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdal301.dll
Path= C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\data

image.png
How is rasterio working and fiona not?

Thanks for the conda suggestion, I have been successful in the past not using conda, which enables me to create small size tools.



On Wed, Nov 25, 2020 at 3:13 PM Simon Norris <snorris@...> wrote:
I have used conda on windows - it makes gdal/fiona/rasterio/geopandas installation much easier:

conda create -n myenv
conda activate myenv
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install gdal
conda install fiona
conda install rasterio

https://geopandas.org/install.html

On Nov 25, 2020, at 12:12 PM, René Buffat <buffat@...> wrote:

I have to say it is a long time ago since I used these wheels on Windows. From what I remember there was no need to set any paths. However, it was important to install all the necessary dependencies (MS C++ redistributable, pip, numpy, gdal etc.). But this could have changed. 

An alternative would be to use conda. The benefit of using conda is that you can install packages over an index and you don't have to install them manually. Fiona is available in conda-forge: https://github.com/conda-forge/fiona-feedstock However, I never used conda on Windows, thus I can't say too much about it. 



--


Eyal Saiet


René Buffat
 

C:/programfiles/gdal does not look like a path from a gohlke gdal wheel. 

https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal says: "This distribution includes a complete GDAL installation. Do not use together with OSGeo4W or gdalwin32." This could be an issue.


Eyal Saiet
 


Rene, I agree 100%, but I thought if  my environment variables were correct that should not have mattered.
Anyhow, I uninstall GDAL from my programs and now rasterio as well cannot find the .dll files. Clearly the environment variable path=  C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdal301.dll  is not working, And, clearly rasterio is not directed to the  osgeo

So I need to do more homework on what I am missing here...



Eyal Saiet
 

cleaned some old paths and reinstalled gdal wheel, rasterio wheel, and fiona wheel.
Trying different path, and other variables in the Environment variable

Now rasterio is back working but fiona still not:
First I tried:

GDAL_DRIVER_PATH value= C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdalplugins

Import rasterio #worked!

Import Fiona    #failed

Created this error:

Can't load requested DLL: C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdalplugins\ogr_FileGDB.dll

126: The specified module could not be found.

 

Can't load requested DLL: C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdalplugins\ogr_FileGDB.dll

126: The specified module could not be found.

 

Can't load requested DLL: C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdalplugins\ogr_FileGDB.dll

126: The specified module could not be found.

 

Can't load requested DLL: C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdalplugins\ogr_FileGDB.dll

126: The specified module could not be found.


Then tried something different  to grab the gdal301.dll file

GDAL_DRIVER_PATH from C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo

Import rasterio #worked!

Import Fiona # failed:

Got the error

Missing global # gdal: DRIVER_NAME declaration in C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdal_array.py

Missing global # gdal: DRIVER_NAME declaration in C:\Users\esaiet\AppData\Local\Programs\Python\Python37\Lib\site-packages\osgeo\gdal_array.py


Maybe someone can give insight into the "Missing global.. Driver_NAME"  and gdal_array.py?


I am missing how fiona and rasterio  interact   differently with GDAL.




René Buffat
 

At this point, I would recommend testing the Gohlke wheels on a clean Windows installation (following the instructions of Gohlkes homepage by the line and e.g. not modifying any environment variable if not required by the instruction etc.) and check if the issues persist on this system.

But I fear I can't contribute more to this discussion. I currently don't have access to a Windows computer and as I said, the last time I used these wheels is a long time ago (But then they worked quite well).