Elise1369
Elise1369

Reputation: 319

Python - pip install - ERROR: A GDAL API version must be specified

I try to install the module contextily to use it on Python.

I went on Anaconda Prompt as admin, and wrote : pip install contextily

I get this error and I have still not found what I have to do :

Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command:'C:\Users\elise\AppData\Local\Continuum\anaconda3\python.exe' 'C:\Users\elise\AppData\Local\Continuum\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py' get_requires_for_build_wheel 'C:\Users\elise\AppData\Local\Temp\tmpwkajt8gq' cwd: C:\Users\elise\AppData\Local\Temp\pip-install-ysq517b2\rasterio
Complete output (2 lines):
INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More information is available in the README.
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.

ERROR: Command errored out with exit status 1: 'C:\Users\elise\AppData\Local\Continuum\anaconda3\python.exe' 'C:\Users\elise\AppData\Local\Continuum\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py' get_requires_for_build_wheel 'C:\Users\elise\AppData\Local\Temp\tmpwkajt8gq' Check the logs for full command output.

(I tried to deal with environment variable like there : No module named ogr but it doesn't help. Neither these solutions : Error installing geopandas:" A GDAL API version must be specified " in Anaconda)

Upvotes: 1

Views: 3210

Answers (2)

Grégoire LB
Grégoire LB

Reputation: 11

Try running the following command using anaconda prompt:
conda install -c conda-forge contextily

You can find the documentation here.

Upvotes: 1

Elise1369
Elise1369

Reputation: 319

I achieved to install packages that I couldn't before, by creating a virtual environment and working on it (it's simple on Anaconda Navigator : Environments/Create, and then using the right part of the navigator to install new packages)

Upvotes: 0

Related Questions