San*_*y H 6 python gdal mapbox rasterio
运行 pip install mapbox-tilesets 时,在收集 rasterio 过程中,我在 Windows 10 计算机上收到以下错误,特别是在构建轮子的要求时出现错误。详细信息如下。
Collecting rasterio
  Using cached rasterio-1.1.8.tar.gz (2.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Sandy Haaf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2032.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\Sandy Haaf\AppData\Local\Temp\tmp5nhr9kl_'
       cwd: C:\Users\Sandy Haaf\AppData\Local\Temp\pip-install-gj86e2z4\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\Sandy Haaf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2032.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\Sandy Haaf\AppData\Local\Temp\tmp5nhr9kl_' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the 'C:\Users\Sandy Haaf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
我找不到 gdal-config 文件,因此无法提供 GDAL-CONFIG 环境变量的路径。
C:\>gdalinfo --version
GDAL 3.1.4, released 2020/10/20
C:\>python --version 
Python 3.8.7
我已经使用http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe重新安装了gdal
我还将c:\OSGeo4W64\bin添加到Path和GDAL_DATA环境变量中。我也尝试将其添加到 GDAL_CONFIG 但没有帮助。
任何帮助,将不胜感激。谢谢!!
不知道这是否有帮助,但我首先使用 conda 安装 rasterio:
conda install -c conda-forge 光栅
然后pip install mapbox-tilesets工作得很好。一般来说,正是由于这个原因,conda 似乎更适合安装空间包(例如 geopandas)。