尽管你安装了 n,但Pip最有可能 over和重塑贵的GDAL版本。 这里对我来说是固定的:
pip3 install --no-cache-dir --force-reinstall GDAL[numpy]==3.6.2
没有<代码>-无-cache-dir的批次 • causes
% pip3 install --force-reinstall GDAL[numpy]==3.6.2
Collecting GDAL[numpy]==3.6.2
Using cached GDAL-3.6.2-cp311-cp311-macosx_13_0_x86_64.whl
Collecting numpy>1.0.0
Using cached numpy-1.24.2-cp311-cp311-macosx_10_9_x86_64.whl (19.8 MB)
Installing collected packages: numpy, GDAL
Attempting uninstall: numpy
Found existing installation: numpy 1.24.2
Uninstalling numpy-1.24.2:
Successfully uninstalled numpy-1.24.2
Attempting uninstall: GDAL
Found existing installation: GDAL 3.6.2
Uninstalling GDAL-3.6.2:
Successfully uninstalled GDAL-3.6.2
Successfully installed GDAL-3.6.2 numpy-1.24.2
对于仍然遇到这一问题的其他人,确保安装<代码>wheel和setuptools
。 Pip将考虑setuptools>=48
,但这是错误的,因为你需要的是64个以上的新人。 与<代码>69.1.1一致
Pip将下载<代码>wheel <>/code>和/或setuptools
,作为建筑过程的一部分,但(截至2024年3月)不会奏效,而是责备:
Building wheels for collected packages: GDAL
Running command Building wheel for GDAL (pyproject.toml)
WARNING: numpy not available! Array support will not be enabled
唯一注明的是wheel
或setuptools
问题表明,在无建筑隔离的情况下建造房屋(-no-build-isolation
):
error: invalid command bdist_wheel
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
Preparing metadata (pyproject.toml) ... done
ERROR: Exception:
Traceback (most recent call last):
...
ModuleNotFoundError: No module named setuptools