使proj_api.h可用于pip install cartopy

时间:2016-11-21 11:31:35

标签: pip cartopy proj4

我正在尝试通过cartopy安装pip install cartopy。我已经安装了proj.4,并在此处放置了必要的文件

~/Downloads/proj-4.9.2 $ ls -l /usr/local/include/proj_api.h -rw-r--r--@ 1 dom admin 5911 Nov 21 11:06 /usr/local/include/proj_api.h

但是pip install找不到它:

gcc -fno-strict-aliasing -I/Applications/SageMath/local/var/tmp/sage/build/python2-2.7.10.p2/include -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -I/Applications/SageMath/local/include -I./lib/cartopy -I/usr/local/Cellar/geos/3.5.0/include -I/Applications/SageMath/local/include/python2.7 -c lib/cartopy/trace.cpp -o build/temp.macosx-10.9-x86_64-2.7/lib/cartopy/trace.o lib/cartopy/trace.cpp:282:22: fatal error: proj_api.h: No such file or directory #include "proj_api.h" ^ compilation terminated. error: command 'gcc' failed with exit status 1

如何在-I/usr/local/include命令中显示gcc之类的内容?某种程度上-I/usr/local/Cellar/geos/3.5.0/include被放在那里。

2 个答案:

答案 0 :(得分:10)

这样可以解决问题:)

sudo apt-get install libproj-dev

答案 1 :(得分:1)

export CFLAGS="-I/usr/local/include"似乎可以解决问题。