Skip to content

Commit cf5a268

Browse files
committed
Add a note for Windows users about the installation of GDAL and rasterio.
1 parent 8efdd59 commit cf5a268

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

README.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ The Labelbox Python API offers a simple, user-friendly way to interact with the
66

77
## Table of Contents
88

9-
* [Requirements](#requirements)
10-
* [Installation](#installation)
11-
* [Documentation](#documentation)
12-
* [Authentication](#authentication)
13-
* [Contribution](#contribution)
14-
* [Testing](#testing)
9+
- [Labelbox Python SDK](#labelbox-python-sdk)
10+
- [Table of Contents](#table-of-contents)
11+
- [Requirements](#requirements)
12+
- [Installation](#installation)
13+
- [Note for Windows users](#note-for-windows-users)
14+
- [Documentation](#documentation)
15+
- [Authentication](#authentication)
16+
- [Contribution](#contribution)
17+
- [Testing](#testing)
1518

1619
## Requirements
1720

@@ -48,6 +51,37 @@ To install dependencies required for data processing modules use:
4851
```
4952
pip install labelbox[data]
5053
```
54+
### Note for Windows users
55+
The package `rasterio` installed by `labelbox[data]` relies on GDAL which could be difficult to install on Microsoft Windows.
56+
57+
You may see the following error message:
58+
59+
```
60+
INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More information is available in the README.
61+
62+
ERROR: 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.
63+
```
64+
65+
As a workaround:
66+
67+
1. Download the binary files for GDAL and rasterio:
68+
69+
a. From https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal, download `GDAL‑3.3.2‑cp38‑cp38‑win_amd64.wh`
70+
71+
b. From https://www.lfd.uci.edu/~gohlke/pythonlibs/#rasterio, download `rasterio‑1.2.9‑cp38‑cp38‑win_amd64.whl`
72+
73+
Note: You need to download the right files for your Python version. In the files above `cp38` means CPython 3.8.
74+
75+
2. After downloading the files, please run the following commands, in this particular order.
76+
77+
```
78+
pip install GDAL‑3.3.2‑cp38‑cp38‑win_amd64.wh
79+
pip install rasterio‑1.2.9‑cp38‑cp38‑win_amd64.whl
80+
pip install labelbox[data]
81+
```
82+
83+
This should resolve the error message.
84+
5185

5286
## Documentation
5387

0 commit comments

Comments
 (0)