# Error al instalar Gdal

**URL:** <https://pyar.discourse.group/t/error-al-instalar-gdal/1279>\
**Category:** Sin categoría\
**Created:** [8 Mayo, 2024 13:11 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279 "2024-05-08T13:11:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![L\_Simo](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@L\_Simo](https://pyar.discourse.group/u/L_Simo)\
**Post date:** [8 Mayo, 2024 13:11 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279/1 "2024-05-08T13:11:35Z")

</div>

Hola a todos y todas, cuando quiero instalar la libreria Gdal me tira el siguiente error  
note: This error originates from a subprocess, and is likely not a problem with pip.  
ERROR: Failed building wheel for gdal  
Failed to build gdal  
ERROR: Could not build wheels for gdal, which is required to install pyproject.toml-based projects  
intente resolverlo instalándolo con el siguiente comando:  
pip install gdal --no-binary :all:  
pero me dice lo mismo.  
Si alguien puede ayudarme se lo agradezco

---

<div class="post-metadata">

**Author:** ![L\_Simo](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@L\_Simo](https://pyar.discourse.group/u/L_Simo)\
**Post date:** [8 Mayo, 2024 13:15 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279/2 "2024-05-08T13:15:17Z")

</div>

Tengo la versión Python 3.12.2 y según leí en internet ¿no funciona con esta versión ?

---

<div class="post-metadata">

**Author:** ![javiermarcon](https://yyz2.discourse-cdn.com/free1/user_avatar/pyar.discourse.group/javiermarcon/32/334_2.png) [@javiermarcon](https://pyar.discourse.group/u/javiermarcon)\
**Post date:** [8 Mayo, 2024 13:52 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279/3 "2024-05-08T13:52:03Z")

</div>

Hola,

No es un problema de la versión, probablemente sea que te falta instalar  
dependencias para que pip pueda compilar el wheel.

Para ayudarte, necesitaríamos saber como y donde instalaste python,  
estas usando Windows, Linux, Macos, FreeBSD, etc? lo instalaste  
descargandolo de [python.org](http://python.org) o desde algun manejador de paquetes (deb,  
rpm, etc.)? Instalaste librerias de desarrollo (como por ejemplo glibc o  
el runtime de c de visual studio)?

Además podes usar la opcion -v de pip para que te de mas detalles de lo  
que pasa (poniendo hasta 3 v para incrementar el nivel de detalle.). Por  
eso te aconsejaria que postees el resultado de pip install -vvv gdal

Saludos,

Javier.

---

<div class="post-metadata">

**Author:** ![L\_Simo](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@L\_Simo](https://pyar.discourse.group/u/L_Simo)\
**Post date:** [8 Mayo, 2024 18:05 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279/4 "2024-05-08T18:05:40Z")

</div>

Gracias por la respuesta. Yo trabajo con Windows y directamente uso la IDLE Shell que viene con el programa, también uso visual studio (no probé si funciona desde aca). No soy un usuario frecuente asi que no tengo instalado nada de las librerías que mencionas  
EL resultado de correr el codigo es  
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: [Microsoft C++ Build Tools - Visual Studio](https://visualstudio.microsoft.com/visual-cpp-build-tools/)  
error: subprocess-exited-with-error

× python setup.py bdist\_wheel did not run successfully.  
│ exit code: 1  
╰─\> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.  
full command: ‘C:\Users\Usuario\AppData\Local\Programs\Python\Python312\python.exe’ -u -c ’  
exec(compile(‘"’“‘’”‘"’‘"’"’

# This is – a caller that pip uses to run setup.py

# 

# - It imports setuptools before invoking setup.py, to enable projects that directly

# import from `distutils.core` to work with newer packaging standards.

# - It provides a clear error message when setuptools is not installed.

# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so

# setuptools doesn’“'”'t think the script is `-c`. This avoids the following warning:

# manifest\_maker: standard file ‘"’“‘-c’”‘"’ not found".

# - It generates a shim setup.py, for handling setup.cfg-only projects.

import os, sys, tokenize

try:  
import setuptools  
except ImportError as error:  
print(  
"ERROR: Can not execute `setup.py` since setuptools is not available in "  
“the build environment.”,  
file=sys.stderr,  
)  
sys.exit(1)

**file** = %r  
sys.argv[0] = **file**

if os.path.exists( **file** ):  
filename = **file**  
with tokenize.open( **file** ) as f:  
setup\_py\_code = f.read()  
else:  
filename = “”  
setup\_py\_code = “from setuptools import setup; setup()”

exec(compile(setup\_py\_code, filename, “exec”))  
‘"’“‘’”‘"’‘"’“’ % ('”‘“‘C:\Users\Usuario\AppData\Local\Temp\pip-install-osy3yuob\gdal\_0a63436913624e27b44d97d8095e08de\setup.py’”’"‘,), “”, “exec”))’ bdist\_wheel -d ‘C:\Users\Usuario\AppData\Local\Temp\pip-wheel-ebrd40hh’  
cwd: C:\Users\Usuario\AppData\Local\Temp\pip-install-osy3yuob\gdal\_0a63436913624e27b44d97d8095e08de  
error  
ERROR: Failed building wheel for gdal  
Running setup.py clean for gdal  
Running command python setup.py clean  
running clean  
removing ‘build\lib.win-amd64-cpython-312’ (and everything under it)  
‘build\bdist.win-amd64’ does not exist – can’t clean it  
‘build\scripts-3.12’ does not exist – can’t clean it  
removing ‘build’  
Failed to build gdal  
ERROR: Could not build wheels for gdal, which is required to install pyproject.toml-based projects  
Exception information:  
Traceback (most recent call last):  
File “C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_internal\cli\base\_command.py”, line 180, in exc\_logging\_wrapper  
status = run\_func(\*args)  
^^^^^^^^^^^^^^^  
File “C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_internal\cli\req\_command.py”, line 245, in wrapper  
return func(self, options, args)  
^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_internal\commands\install.py”, line 429, in run  
raise InstallationError(  
pip.\_internal.exceptions.InstallationError: Could not build wheels for gdal, which is required to install pyproject.toml-based projects  
Remote version of pip: 24.0  
Local version of pip: 24.0  
Was pip installed by pip? True  
Removed build tracker: ‘C:\Users\Usuario\AppData\Local\Temp\pip-build-tracker-vf20q3gj’  
Saludos

---

<div class="post-metadata">

**Author:** ![javiermarcon](https://yyz2.discourse-cdn.com/free1/user_avatar/pyar.discourse.group/javiermarcon/32/334_2.png) [@javiermarcon](https://pyar.discourse.group/u/javiermarcon)\
**Post date:** [9 Mayo, 2024 13:24 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279/5 "2024-05-09T13:24:32Z")

</div>

La primer linea del error te dice que es lo que te falta instalar y  
donde conseguirlo: “error: Microsoft Visual C++ 14.0 or greater is  
required. Get it with “Microsoft C++ Build Tools”: Microsoft C++ Build  
Tools - Visual Studio  
[https://visualstudio.microsoft.com/visual-cpp-build-tools/](https://visualstudio.microsoft.com/visual-cpp-build-tools/)”

Para poder compilar te falta instalar los build tools de C de Visual  
studio. Instalando eso te deberia funcionar.

Saludos,

Javier.

---

<div class="post-metadata">

**Author:** ![L\_Simo](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@L\_Simo](https://pyar.discourse.group/u/L_Simo)\
**Post date:** [10 Mayo, 2024 18:24 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279/6 "2024-05-10T18:24:29Z")

</div>

Hola Javier, muchas gracias por tu ayuda. descargue e instale Microsoft C++ Build Tools y volvi a correr el comando pip install -vvv gdal y si bien hace mas cosas que antes me sigue apareciendo un error  
error: command ‘C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe’ failed with exit code 2  
error: subprocess-exited-with-error

× Building wheel for gdal (pyproject.toml) did not run successfully.  
│ exit code: 1  
╰─\> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.  
full command: ‘C:\Users\Usuario\AppData\Local\Programs\Python\Python312\python.exe’ ‘C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject\_hooks\_in\_process\_in\_process.py’ build\_wheel ‘C:\Users\Usuario\AppData\Local\Temp\tmpzlkvwnp7’  
cwd: C:\Users\Usuario\AppData\Local\Temp\pip-install-2yfabt9\_\gdal\_ff086a7c527d43e2a4dd43df46c68eec  
Building wheel for gdal (pyproject.toml) … error  
ERROR: Failed building wheel for gdal  
Failed to build gdal  
ERROR: Could not build wheels for gdal, which is required to install pyproject.toml-based projects  
Exception information:  
Traceback (most recent call last):  
File “C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_internal\cli\base\_command.py”, line 180, in exc\_logging\_wrapper  
status = run\_func(\*args)  
^^^^^^^^^^^^^^^  
File “C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_internal\cli\req\_command.py”, line 245, in wrapper  
return func(self, options, args)  
^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_internal\commands\install.py”, line 429, in run  
raise InstallationError(  
pip.\_internal.exceptions.InstallationError: Could not build wheels for gdal, which is required to install pyproject.toml-based projects  
Remote version of pip: 24.0  
Local version of pip: 24.0  
Was pip installed by pip? True  
Removed build tracker: ‘C:\Users\Usuario\AppData\Local\Temp\pip-build-tracker-5nfe3fyc’

La verdad no se como seguir  
Saludos

---

<div class="post-metadata">

**Author:** ![javiermarcon](https://yyz2.discourse-cdn.com/free1/user_avatar/pyar.discourse.group/javiermarcon/32/334_2.png) [@javiermarcon](https://pyar.discourse.group/u/javiermarcon)\
**Post date:** [11 Mayo, 2024 11:23 UTC](https://pyar.discourse.group/t/error-al-instalar-gdal/1279/7 "2024-05-11T11:23:20Z")

</div>

Ka verdad es que no veo la causa de tu error, yo desde hace mas de 10  
años que no uso windows, asi que no podria reproducirlo, pero probaria  
ejecutar lo que dice en “full command” a ver que te dice, y googlear  
instalacion de gdal en windows. Lo mejor seria fijarte su conseguis el  
wheel e instalar directamente el wheel.
