我正试图从虚拟环境(Ubuntu)中的pip pip install gdal
安装gdal。它失败,因为它找不到cpl_port.h
extensions/gdal_wrap.cpp:2853:22: fatal error: cpl_port.h: No such file or directory
compilation terminated
但是,GDAL安装正确,头文件位于/usr/include/gdal/cpl_port.h
。是否需要为GDAL设置一些环境变量,以便pip查找头文件?
Tags:
正如the other thread中所建议的,在运行pip之前导出一些shell变量可以完美地工作。可以使用
gdal-config --cflags
找到*_INCLUDE_PATH
的路径。Tomyun的回答对我有效,但前提是必须确保通过
apt-get
安装的GDAL dev版本与通过pip
安装的版本匹配。对于Ubuntu 14.04,命令是:
使用PIP:
然后cd到ENV/build/GDAL
(来源:http://ubuntuforums.org/showthread.php?t=1769445)
使用构建:
相关问题 更多 >
编程相关推荐