[QGIS-Developer] osgeo4w setup automation script (and geopandas error)

Idan Miara idan at miara.com
Sun Dec 30 05:45:08 PST 2018


Hi,

I've made a script that automates osgeo4w setup:
https://github.com/talos-gis/osgeo4w_setup_script/blob/master/osgeo4w_setup_script.py

You may use it if you find it useful.

This script does the following:
    0. downloads the osgeo4w setup file.
    1. runs the setup with given packages list.
    2. makes an osgeo4w py3 batch file.
    3. installs additional python3 packages using pip.
    4. works for 32bit and/or 64bit setups

Some toughs from the process:
1. the --site parameter should be 'http://download.osgeo.org/osgeo4w/' and
not 'http://download.osgeo.org' as appears on the GUI list.
2. if --site is not provided then '--quiet-mode --autoaccept' don't work
3. is there a difference between installing 'python3-pandas' osgeo4w
package and the standard 'pandas' package via pip? it looks like it
installs the same package.
4. I couldn't install 'geopandas' with pip (because fiona failedto
install), I attached the error log. anyone else could?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20181230/78da1b77/attachment.html>
-------------- next part --------------
D:\OSGeo4W64>set GDAL_VERSION=2.4

D:\OSGeo4W64>python -m pip install geopandas
Collecting geopandas
  Using cached https://files.pythonhosted.org/packages/24/11/d77c157c16909bd77557d00798b05a5b6615ed60acb5900fbe6a65d35e93/geopandas-0.4.0-py2.py3-none-any.whl
Requirement already satisfied: pandas in d:\osgeo4w64\apps\python37\lib\site-packages (from geopandas) (0.23.4)
Collecting fiona (from geopandas)
  Using cached https://files.pythonhosted.org/packages/3a/16/84960540e9fce61d767fd2f0f1d95f4c63e99ab5d8fddc308e8b51b059b8/Fiona-1.8.4.tar.gz
Collecting shapely (from geopandas)
  Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
Collecting pyproj (from geopandas)
  Downloading https://files.pythonhosted.org/packages/26/8c/1da0580f334718e04f8bbf74f0515a7fb8185ff96b2560ce080c11aa145b/pyproj-1.9.6.tar.gz (2.8MB)
    100% |????????????????????????????????| 2.8MB 1.7MB/s
Requirement already satisfied: pytz>=2011k in d:\osgeo4w64\apps\python37\lib\site-packages (from pandas->geopandas) (2018.5)
Requirement already satisfied: python-dateutil>=2.5.0 in d:\osgeo4w64\apps\python37\lib\site-packages (from pandas->geopandas) (2.7.3)
Requirement already satisfied: numpy>=1.9.0 in d:\osgeo4w64\apps\python37\lib\site-packages (from pandas->geopandas) (1.15.3)
Collecting attrs>=17 (from fiona->geopandas)
  Downloading https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting click<8,>=4.0 (from fiona->geopandas)
  Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
    100% |????????????????????????????????| 81kB 1.4MB/s
Collecting cligj>=0.5 (from fiona->geopandas)
  Downloading https://files.pythonhosted.org/packages/e4/be/30a58b4b0733850280d01f8bd132591b4668ed5c7046761098d665ac2174/cligj-0.5.0-py3-none-any.whl
Collecting click-plugins>=1.0 (from fiona->geopandas)
  Downloading https://files.pythonhosted.org/packages/95/dd/fef84cf1678418f241ef542c0288bdf215bdd3e35f1fe03dc5223a2e80ba/click_plugins-1.0.4-py2.py3-none-any.whl
Requirement already satisfied: six>=1.7 in d:\osgeo4w64\apps\python37\lib\site-packages (from fiona->geopandas) (1.11.0)
Collecting munch (from fiona->geopandas)
  Downloading https://files.pythonhosted.org/packages/68/f4/260ec98ea840757a0da09e0ed8135333d59b8dfebe9752a365b04857660a/munch-2.3.2.tar.gz
Installing collected packages: attrs, click, cligj, click-plugins, munch, fiona, shapely, pyproj, geopandas
  Running setup.py install for munch ... done
  Running setup.py install for fiona ... error
    Complete output from command D:\OSGeo4W64\apps\Python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\idanm\\AppData\\Local\\Temp\\pip-install-_8ysc8y0\\fiona\\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\idanm\AppData\Local\Temp\pip-record-3048ker5\install-record.txt --single-version-externally-managed --compile:
    D:\OSGeo4W64\apps\Python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'metadata_version'
      warnings.warn(msg)
    D:\OSGeo4W64\apps\Python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'requires_python'
      warnings.warn(msg)
    D:\OSGeo4W64\apps\Python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'requires_external'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\fiona
    copying .\fiona\collection.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\compat.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\crs.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\drvsupport.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\env.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\errors.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\inspector.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\io.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\logutils.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\path.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\rfc3339.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\session.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\transform.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\vfs.py -> build\lib.win-amd64-3.7\fiona
    copying .\fiona\__init__.py -> build\lib.win-amd64-3.7\fiona
    creating build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\bounds.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\calc.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\cat.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\collect.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\distrib.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\dump.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\env.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\filter.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\helpers.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\info.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\insp.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\load.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\ls.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\main.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\options.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\rm.py -> build\lib.win-amd64-3.7\fiona\fio
    copying .\fiona\fio\__init__.py -> build\lib.win-amd64-3.7\fiona\fio
    running build_ext
    building 'fiona.schema' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\fiona
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\OSGeo4W64\apps\Python37\include -ID:\OSGeo4W64\apps\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcfiona/schema.c /Fobuild\temp.win-amd64-3.7\Release\fiona/schema.obj
    schema.c
    fiona/schema.c(28): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "D:\OSGeo4W64\apps\Python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\idanm\\AppData\\Local\\Temp\\pip-install-_8ysc8y0\\fiona\\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\idanm\AppData\Local\Temp\pip-record-3048ker5\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\idanm\AppData\Local\Temp\pip-install-_8ysc8y0\fiona\

D:\OSGeo4W64>


More information about the QGIS-Developer mailing list