如何解决rasterio安装问题

5
当我安装rasterio库时,出现了下面提到的类型错误。如何克服它?有人能帮助我提供完整的过程吗?虽然我按照https://rasterio.readthedocs.io/en/stable/installation.html中提供的安装说明进行操作,但无法避免出现错误。
C:\Python27\Scripts>pip install rasterio
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting rasterio
  Using cached https://files.pythonhosted.org/packages/f7/03/1dcc14b0c77ec4c4ca4bd917527bc41fdbba49f56015d535f3d781c826aa/rasterio-1.0.28.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\user\appdata\local\temp\tmpd49eu2'
       cwd: c:\users\user\appdata\local\temp\pip-install-rm7g58\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:\python27\python.exe' 'c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\user\appdata\local\temp\tmpd49eu2' Check the logs for full command output.

这里提出了类似的问题:https://dev59.com/sVMI5IYBdhLWcg3wIn5m - ashnair1
1个回答

0

如果您正在使用Anaconda,您可以使用下面的代码来安装rasterio或任何其他在pip安装时显示此类错误的软件包。

conda install -c conda-forge rasterio

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接