GDAL error when installing Geopandas/Fiona in venv isolation mode

I want to switch from using the isolation mode from Docker to venv, so I used the viktor-cli configure command and provided the path to my Python installation. This env contains several packages including Geopandas, which has Fiona as a dependency.

While I encountered no problems using Docker, I get the error below regarding Fiona and GDAL when using venv. The same error pops up when simply installing Geopandas in a regular venv, so it is not necessarily a problem related to VIKTOR, but it does prevent me from the venv isolation mode. Does anyone know a solution for this?

WARNING: you are developing with Python 3.8, while the published app runs on Python 3.7. The Python version of the published app can be specified by setting 'python_version' in the viktor.config.toml file

SDK version: 13.2.1 Connector version: 5.16.0
Creating app specific install dir signals
Creating virtual environment
Looking in indexes: https://martijn.kriebel%40wsp.com:****@sys.viktor.ai/api/v1/packages/
Collecting viktor==13.2.1
  Downloading https://viktor-system.s3.amazonaws.com/packages/viktor/viktor-13.2.1-cp38-cp38-win_amd64.whl?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA53GKZRCUAHO7GC7K%2F20220803%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20220803T095518Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=21b0a5cabe569f9d52f682dd8b73fca18d70173460441e99a0fda15410f48325 (7.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.7/7.7 MB 9.9 MB/s eta 0:00:00
Collecting viktor-connector==5.16.0
  Downloading https://viktor-system.s3.amazonaws.com/packages/viktor-connector/viktor_connector-5.16.0-cp38-cp38-win_amd64.whl?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA53GKZRCUAHO7GC7K%2F20220803%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20220803T095520Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=f711a27a95c3853e0fc65de315d27c8d9a6348b642ba2ebc77e9700e5a5e5125 (674 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 674.4/674.4 KB 10.7 MB/s eta 0:00:00

Collecting geopandas==0.9.0
  Using cached geopandas-0.9.0-py2.py3-none-any.whl (994 kB)
Collecting pandas<2.0.0,>=0.23.4
  Using cached pandas-1.4.3-cp38-cp38-win_amd64.whl (10.6 MB)
Collecting fiona>=1.8
  Using cached Fiona-1.8.21.tar.gz (1.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Exiting because of an error: installation of the app failed

Hi Martijn,

On Windows GDAL needs to be built from source. The error is caused by the fact that not all build dependencies required for this process are correctly set up. You can either try to get everything sorted in order to built the Python package from source or you can use an unofficial distribution as explained in the second bullet of this link: Getting Started - Troubleshooting | VIKTOR Documentation. Please not that you will need to account for the fact that published apps will run on Linux.

Regards,

Raoul