尝试安装GDAL - Python 3.9.9 - Pip - Windows 10

cfh9epnr  于 2023-05-05  发布在  Python
关注(0)|答案(3)|浏览(238)

我正在尝试使用pip install gdal安装gdal库
我正在使用:

  • Python 3.9.9
  • Windows 10系统

但我有这个错误:
C:\Users\托马斯〉pip install gdal
Using cached GDAL-3.4.1.tar.gz(755 kB)Preparing metadata(setup.py)...done为收集的包构建轮子:gdal Building wheel for gdal(setup.py)...错误错误:命令出错,退出状态为1:command:'C:\Users\Thomas\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io,os,sys,setuptools,tokenize;2019 - 05 - 22 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00file='"'“' C:\Users\托马斯\AppData\Local\Temp\pip-install-a6f2h5t3\gdal_bda2b7753d014f62ac5710c803768ff3\setup.py'" '”';f = getattr(tokenize,'“'”'open'" "',open)(file)if os.path.exists(file)else io.StringIO('"'"' from setuptools import setup;setup. add();代码=f.read().replace('"'"'\r\n'"'“','”'"'\n'"'“');f.close();exec(compile(code,file,'“'”'exec'"'“'))' bdist_wheel -d 'C:\Users\托马斯\AppData\Local\Temp\pip-wheel-hfvfe4bv' cwd:C:\Users\托马斯\AppData\Local\Temp\pip-install-a6f2h5t3\gdal_bda2b7753d014f62ac5710c803768ff3
完整输出(118行):运行bdist_wheel运行构建

running build_py creating build creating build\lib.win-amd64-3.10 creating build\lib.win-amd64-3.10\osgeo copying osgeo\gdal.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gdalconst.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gdalnumeric.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gdal_array.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gnm.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\ogr.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\osr.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\utils.py -> build\lib.win-amd64-3.10\osgeo copying osgeo_init.py -> build\lib.win-amd64-3.10\osgeo creating build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal2tiles.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal2xyz.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdalattachpct.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdalcompare.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdalmove.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_calc.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_edit.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_fillnodata.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_merge.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_pansharpen.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_polygonize.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_proximity.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_retile.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_sieve.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\ogrmerge.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\pct2rgb.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\rgb2pct.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utilsinit.py -> build\lib.win-amd64-3.10\osgeo_utils creating build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\array_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\base.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\batch_creator.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\color_palette.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\color_table.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\extent_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\gdal_argparse.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\numpy_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\osr_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\progress.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\raster_creation.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\rectangle.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliaryinit.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary creating build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\assemblepoly.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\build_jp2_from_xml.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\classify.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\crs2crs2grid.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\densify.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\dump_jp2.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\epsg_tr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\esri2wkt.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\fft.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\fix_gpkg.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gcps2ogr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gcps2vec.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gcps2wld.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal2grd.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalchksum.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalcopyproj.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalfilter.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalident.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalimport.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalinfo.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdallocationinfo.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_auth.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_cp.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_create_pdf.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_ls.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_lut.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_mkdir.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_remove_towgs84.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_rm.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_rmdir.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_vrtmerge.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_zip.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\get_soundg.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\histrep.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\hsv_merge.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\jpeg_in_tiff_extract.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\load2odbc.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\loslas2ntv2.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\magphase.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\make_fuzzer_friendly_archive.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\mkgraticule.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr2ogr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr2vrt.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogrinfo.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogrupdate.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr_build_junction_table.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr_dispatch.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr_layer_algebra.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\rel.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\tigerpoly.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\tile_extent_from_raster.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\tolatlong.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\validate_cloud_optimized_geotiff.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\validate_gpkg.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\validate_jp2.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\val_repl.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\vec_tr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\vec_tr_spat.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\wcs_virtds_params.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samplesinit_.py -> build\lib.win-amd64-3.10\osgeo_utils\samples running build_ext

building 'osgeo._gdal' extension building 'osgeo._ogr' extension
building 'osgeo.*osr' extension building 'osgeo.*gdalconst' extension building 'osgeo.*gdal_array' extension building 'osgeo.*gnm' extension error:需要Microsoft Visual C++ 14.0或更高版本。使用“Microsoft C++ Build Tools”:https://visualstudio.microsoft.com/visual-cpp-build-tools/
-------------------为gdal构建wheel失败正在为gdal运行setup.pyclean无法构建gdal安装收集的软件包:gdal Running setup.py install for gdal...错误错误:命令出错,退出状态为1:command:'C:\Users\Thomas\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io,os,sys,setuptools,tokenize;2019 - 05 - 22 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00file='"'“' C:\Users\托马斯\AppData\Local\Temp\pip-install-a6f2h5t3\gdal_bda2b7753d014f62ac5710c803768ff3\setup.py'" '”';f = getattr(tokenize,'“'”'open'" "',open)(file)if os.path.exists(file)else io.StringIO('"'"' from setuptools import setup;setup. add();代码=f.read().replace('"'"'\r\n'"'“','”'"'\n'"'“');f.close();exec(compile(code,file,'“'”'exec'"'“'))' install --record 'C:\Users\Thomas\AppData\Local\Temp\pip-record-cpcsirol\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Thomas\AppData\Local\Programs\Python\Python310\Include\gdal' cwd:C:\Users\托马斯\AppData\Local\Temp\pip-install-a6f2h5t3\gdal_bda2b7753d014f62ac5710c803768ff3

Complete output (118 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.10 creating build\lib.win-amd64-3.10\osgeo copying osgeo\gdal.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gdalconst.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gdalnumeric.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gdal_array.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\gnm.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\ogr.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\osr.py -> build\lib.win-amd64-3.10\osgeo copying osgeo\utils.py -> build\lib.win-amd64-3.10\osgeo copying osgeo_init*.py -> build\lib.win-amd64-3.10\osgeo creating build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal2tiles.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal2xyz.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdalattachpct.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdalcompare.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdalmove.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_calc.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_edit.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_fillnodata.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_merge.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_pansharpen.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_polygonize.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_proximity.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_retile.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\gdal_sieve.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\ogrmerge.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\pct2rgb.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils\rgb2pct.py -> build\lib.win-amd64-3.10\osgeo_utils copying gdal-utils\osgeo_utils_init*.py -> build\lib.win-amd64-3.10\osgeo_utils creating build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\array_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\base.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\batch_creator.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\color_palette.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\color_table.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\extent_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\gdal_argparse.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\numpy_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\osr_util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\progress.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\raster_creation.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\rectangle.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary\util.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary copying gdal-utils\osgeo_utils\auxiliary_init*.py -> build\lib.win-amd64-3.10\osgeo_utils\auxiliary creating build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\assemblepoly.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\build_jp2_from_xml.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\classify.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\crs2crs2grid.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\densify.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\dump_jp2.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\epsg_tr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\esri2wkt.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\fft.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\fix_gpkg.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gcps2ogr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gcps2vec.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gcps2wld.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal2grd.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalchksum.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalcopyproj.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalfilter.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalident.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalimport.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdalinfo.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdallocationinfo.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_auth.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_cp.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_create_pdf.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_ls.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_lut.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_mkdir.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_remove_towgs84.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_rm.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_rmdir.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_vrtmerge.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\gdal_zip.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\get_soundg.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\histrep.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\hsv_merge.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\jpeg_in_tiff_extract.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\load2odbc.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\loslas2ntv2.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\magphase.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\make_fuzzer_friendly_archive.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\mkgraticule.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr2ogr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr2vrt.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogrinfo.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogrupdate.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr_build_junction_table.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr_dispatch.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\ogr_layer_algebra.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\rel.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\tigerpoly.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\tile_extent_from_raster.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\tolatlong.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\validate_cloud_optimized_geotiff.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\validate_gpkg.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\validate_jp2.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\val_repl.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\vec_tr.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\vec_tr_spat.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples\wcs_virtds_params.py -> build\lib.win-amd64-3.10\osgeo_utils\samples copying gdal-utils\osgeo_utils\samples_init*.py -> build\lib.win-amd64-3.10\osgeo_utils\samples running build_ext building 'osgeo._gdal' extension building 'osgeo._ogr' extension building 'osgeo._gnm' extension building 'osgeo._gdalconst' extension building 'osgeo._osr' extension building 'osgeo._gdal_array' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\Thomas\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Thomas\AppData\Local\Temp\pip-install-a6f2h5t3\gdal_bda2b7753d014f62ac5710c803768ff3\setup.py'"'"'; file='"'"'C:\Users\Thomas\AppData\Local\Temp\pip-install-a6f2h5t3\gdal_bda2b7753d014f62ac5710c803768ff3\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Thomas\AppData\Local\Temp\pip-record-cpcsirol\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Thomas\AppData\Local\Programs\Python\Python310\Include\gdal' Check the logs for full command output.

我试图安装最新版本的Microsoft Visual C++,但它并没有改变任何东西。

有人知道我该怎么做吗?

f8rj6qna

f8rj6qna1#

我在Windows 10上使用的唯一GDAL来自Christoph Gohlke的 *Unofficial Windows Binaries for Python Extension Packages * 这里
出于好奇,GeoPandas项目也推荐Windows的非官方存储库。
如果它死了,请尝试this另一个非官方来源。这是由Erin Turnbull从原始Christoph Gohlke网站提供的。

v8wbuo2f

v8wbuo2f2#

谢谢@iambr,它工作得很好!
下载正确的扩展包后由Christoph Gohlke在这里
我用pip安装了这个包

py -3.9 -m pip install D:\Downloads\GDAL-3.4.1-cp39-cp39-win_amd64.whl

或(取决于Python版本)

py -3.10 -m pip install D:\Downloads\GDAL-3.4.1-cp310-cp310-win_amd64.whl
u3r8eeie

u3r8eeie3#

在做了@托马斯LESIEUR的建议之后,你打电话给

  • import gdal但不工作,您可以使用
  • from osgeo import gdal在第一个选项失败后,它为我工作

相关问题