相关疑难解决方法(0)

通过pip安装时,Python GDAL包缺少头文件

我正在尝试从pip install gdal虚拟环境(Ubuntu)中的pip安装gdal .它失败了,因为找不到cpl_port.h

extensions/gdal_wrap.cpp:2853:22: fatal error: cpl_port.h: No such file or directory
compilation terminated
Run Code Online (Sandbox Code Playgroud)

但是,正确安装了GDAL并且头文件位于/usr/include/gdal/cpl_port.h.是否有一些GDAL的环境变量需要设置才能让pip找到头文件?

python gdal

20
推荐指数
4
解决办法
3万
查看次数

无法在 macos Sierra 中的 python 3.6.1 中安装 gdal

我试图在 python 3.6.1 中安装 gdal,但出现以下错误。如何克服这一点?

bibinwilson ~ $ pip3 install gdal
Run Code Online (Sandbox Code Playgroud)
Collecting gdal   Downloading GDAL-2.2.1.tar.gz (475kB)
100% |????????????????????????????????| 481kB 397kB/s 
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/GDAL.egg-info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing manifest file 'pip-egg-info/GDAL.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

Traceback (most recent call last):
  File "/private/var/folders/43/7yqv__4j5776m508kggs_dxm0000gn/T/pip-build-naebgem9/gdal/setup.py",
line 131, in fetch_config
    p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py",
line 707, in __init__
    restore_signals, start_new_session)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py",
  line …
Run Code Online (Sandbox Code Playgroud)

python macos gdal

8
推荐指数
1
解决办法
7128
查看次数

标签 统计

gdal ×2

python ×2

macos ×1