没有这样的文件或目录:'gdal-config'

ema*_*max 20 python macos gdal python-3.x fiona

我正在尝试在 mac 机器上安装fiona和。geopandas

\n

我已经安装了GDALbrew install gdal --HEAD

\n

如果我尝试安装fiona,我会得到以下信息:

\n
sudo pip3 install fiona\nCollecting fiona\n  Downloading Fiona-1.8.18.tar.gz (1.3 MB)\n     |\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88| 1.3 MB 4.7 MB/s \n    ERROR: Command errored out with exit status 1:\n     command: /usr/local/opt/python@3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-sk0rqerp/fiona_e389978ed5a44635a5158a0ba3df8562/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-sk0rqerp/fiona_e389978ed5a44635a5158a0ba3df8562/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\\r\\n'"'"', '"'"'\\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-bngdnoq7\n         cwd: /private/tmp/pip-install-sk0rqerp/fiona_e389978ed5a44635a5158a0ba3df8562/\n    Complete output (2 lines):\n    Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'\n    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.\n    ----------------------------------------\nERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\n
Run Code Online (Sandbox Code Playgroud)\n

Mar*_*ark 9

当我尝试在 M1 Mac 上安装 geopandas 时,出现了这个问题(使用命令pip3 install geopandas

使用homebrew包管理器安装gdal包:

brew install gdal

然后再次尝试安装失败的 pip install:

pip3 install geopandas