鱼C论坛

 找回密码
 立即注册
楼主: jingtiandi123

[技术交流] @fishc小助手

[复制链接]
发表于 2024-10-4 11:01:33 | 显示全部楼层
jingtiandi123 发表于 2024-10-04 11:01
Traceback (most recent call last):
  File "C:\Use ...


这个错误表明你的系统中缺少`osgeo`模块,这是GDAL库的一部分。要解决这个问题,你可以安装GDAL库。以下是安装步骤:

1. **通过conda安装**(推荐):
   如果你使用的是Anaconda,可以通过以下命令安装:
conda install -c conda-forge gdal

2. **通过pip安装**:
   如果使用pip,可以尝试:
pip install GDAL
   注意在

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-10-4 11:02:31 | 显示全部楼层
FishC 发表于 2024-10-4 11:01
这个错误表明你的系统中缺少`osgeo`模块,这是GDAL库的一部分。要解决这个问题,你可以安装GDAL库。以 ...

C:\Users\li\AppData\Local\Programs\Python\Python37\Scripts>pip install GDAL
Collecting GDAL
  Downloading GDAL-3.8.5.tar.gz (802 kB)
     ---------------------------------------- 802.6/802.6 kB 2.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: GDAL
  Building wheel for GDAL (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for GDAL (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [117 lines of output]
      WARNING: numpy not available!  Array support will not be enabled
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-37
      creating build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\gdal.py -> build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\gdalconst.py -> build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\gdalnumeric.py -> build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\gdal_array.py -> build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\gnm.py -> build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\ogr.py -> build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\osr.py -> build\lib.win-amd64-cpython-37\osgeo
      copying osgeo\__init__.py -> build\lib.win-amd64-cpython-37\osgeo
      creating build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal2tiles.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal2xyz.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdalattachpct.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdalcompare.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdalmove.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_calc.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_edit.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_fillnodata.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_merge.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_pansharpen.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_polygonize.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_proximity.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_retile.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\gdal_sieve.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\ogrmerge.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\ogr_layer_algebra.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\pct2rgb.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\rgb2pct.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      copying gdal-utils\osgeo_utils\__init__.py -> build\lib.win-amd64-cpython-37\osgeo_utils
      creating build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\array_util.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\base.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\batch_creator.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\color_palette.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\color_table.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\extent_util.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\gdal_argparse.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\numpy_util.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\osr_util.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\progress.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\raster_creation.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\rectangle.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\util.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      copying gdal-utils\osgeo_utils\auxiliary\__init__.py -> build\lib.win-amd64-cpython-37\osgeo_utils\auxiliary
      creating build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\assemblepoly.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\build_jp2_from_xml.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\classify.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\crs2crs2grid.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\densify.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\dump_jp2.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\epsg_tr.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\esri2wkt.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\fft.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\fix_gpkg.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gcps2ogr.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gcps2vec.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gcps2wld.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal2grd.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdalchksum.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdalcopyproj.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdalfilter.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdalident.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdalimport.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdalinfo.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdallocationinfo.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_auth.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_cp.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_create_pdf.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_ls.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_lut.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_mkdir.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_remove_towgs84.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_rm.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_rmdir.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\gdal_vrtmerge.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\get_soundg.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\histrep.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\hsv_merge.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\jpeg_in_tiff_extract.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\load2odbc.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\loslas2ntv2.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\magphase.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\make_fuzzer_friendly_archive.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\mkgraticule.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\ogr2ogr.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\ogr2vrt.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\ogrinfo.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\ogrupdate.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\ogr_build_junction_table.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\ogr_dispatch.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\rel.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\tigerpoly.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\tile_extent_from_raster.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\tolatlong.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\validate_cloud_optimized_geotiff.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\validate_geoparquet.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\validate_gpkg.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\validate_jp2.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\val_repl.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\vec_tr.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\vec_tr_spat.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\wcs_virtds_params.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      copying gdal-utils\osgeo_utils\samples\__init__.py -> build\lib.win-amd64-cpython-37\osgeo_utils\samples
      running build_ext
      building 'osgeo._gdal' extension
      building 'osgeo._osr' extension
      building 'osgeo._ogr' extension
      building 'osgeo._gdalconst' extension
      building 'osgeo._gnm' 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/  
      [end of output]

  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
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-10-4 11:02:36 | 显示全部楼层
jingtiandi123 发表于 2024-10-04 11:02
C:\Users\li\AppData\Local\Programs\Python\Python37 ...


在安装GDAL时遇到的问题通常与编译它所需的工具有关。以下是几个解决方法:

1. **安装预编译的GDAL二进制包:**
   - 可以使用[Unofficial Windows Binaries for Python Extension Packages](https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal)网站上提供的预编译包。
   - 下载与您Python版本相符的GDAL `.whl` 文件,然后用`pip install <filename>`命令安装。

2. **安装Visual C++ Build Tools:**
   - 根据错误信息,您需要安装Microsoft Visual C++

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-10-28 13:28:16 | 显示全部楼层
FishC 发表于 2024-7-17 19:16
哈哈,鱼油,这个错误其实挺常见的。原因是你把 `correct_type` 定义在装饰器的外层,但在被装饰的函数 ...

在不在
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-10-28 13:28:21 | 显示全部楼层


在的,有什么问题请问吧!

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-21 20:12

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表