python - Rasterio 安装失败

标签 python gdal rasterio

我正在尝试在 python 2.7 安装上将我的 rasterio 版本从 0.25 更新到 0.32,但遇到了麻烦。问题。有关如何修复它的任何信息?

 Running setup.py clean for rasterio
Failed to build rasterio
Installing collected packages: rasterio
  Found existing installation: rasterio 0.25.0
    Uninstalling rasterio-0.25.0:
      Successfully uninstalled rasterio-0.25.0
  Running setup.py install for rasterio: started
    Running setup.py install for rasterio: finished with status 'error'
    Complete output from command C:\Anaconda64\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\rit\\appdata\\local\\temp\\pip-build-dvzvvz\\rasterio\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\rit\appdata\local\temp\pip-4qousd-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-2.7
    creating build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\coords.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\crs.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\dtypes.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\enums.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\errors.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\features.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\fill.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\five.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\profiles.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\sample.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\tool.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\transform.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\vfs.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\warnings.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\warp.py -> build\lib.win-amd64-2.7\rasterio
    copying .\rasterio\__init__.py -> build\lib.win-amd64-2.7\rasterio
    creating build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\bands.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\calc.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\convert.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\features.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\helpers.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\info.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\main.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\merge.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\options.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\overview.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\sample.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\warp.py -> build\lib.win-amd64-2.7\rasterio\rio
    copying .\rasterio\rio\__init__.py -> build\lib.win-amd64-2.7\rasterio\rio
    creating build\lib.win-amd64-2.7\rasterio\tools
    copying .\rasterio\tools\mask.py -> build\lib.win-amd64-2.7\rasterio\tools
    copying .\rasterio\tools\merge.py -> build\lib.win-amd64-2.7\rasterio\tools
    copying .\rasterio\tools\__init__.py -> build\lib.win-amd64-2.7\rasterio\tools
    running egg_info
    writing requirements to rasterio.egg-info\requires.txt
    writing rasterio.egg-info\PKG-INFO
    writing top-level names to rasterio.egg-info\top_level.txt
    writing dependency_links to rasterio.egg-info\dependency_links.txt
    writing entry points to rasterio.egg-info\entry_points.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'rasterio.egg-info\SOURCES.txt'
    writing manifest file 'rasterio.egg-info\SOURCES.txt'
    running build_ext
    building 'rasterio._base' extension
    creating build\temp.win-amd64-2.7
    creating build\temp.win-amd64-2.7\Release
    creating build\temp.win-amd64-2.7\Release\rasterio
    C:\Users\rit\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Anaconda64\lib\site-packages\numpy\core\include -IC:\Anaconda64\include -IC:\Anaconda64\PC /Tcrasterio/_base.c /Fobuild\temp.win-amd64-2.7\Release\rasterio/_base.obj
    _base.c
    rasterio/_base.c(263) : fatal error C1083: Cannot open include file: 'cpl_conv.h': No such file or directory
    error: command 'C:\\Users\\rit\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
  Rolling back uninstall of rasterio

最佳答案

您可以从 https://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载 rasterio‑1.0a10‑cp27‑cp27m‑win32.whl 和 GDAL‑2.2.2‑cp27‑cp27m‑win32.whl。 .如果可用,请卸载另一个 GDAL 版本。然后使用pip安装GDAL和rasterio。

关于python - Rasterio 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36207842/

相关文章:

python - 使用参数调用和执行并在 Python 脚本中更有效地获取其 STDOUT

python - 使用 GDAL 在 Python 和 Matplotlib 中读取 TIFF

python - 在 python 上处理大型 geotiff 时出现内存错误

python-xarray:如何将多个波段和日期的单个波段栅格数据转换为 xarray-Dataset 或 DataArray?

python - 在 Kivy 应用程序中根据 bool 条件更改标签

python - 将深层嵌套的 json 从 facebook 转换为 python 中的数据框

r - 如何在 Leaflet for R 中渲染使用 gdal2tiles 创建的自定义 map 图 block ?

python - 使用 rasterio 将数组保存为 Geotiff

python - 如何通过css选择器选择标签

python - 从我这边检查具有 is_valid 属性、错误或误解的 shapely.geometry.LinearRing 对象的有效状态?