[英]Install cartopy using pip on mac os and macports
I am trying to install cartopy
on OS X 10.10 (Yosemite). 我正在尝试在OS X 10.10(Yosemite)上安装
cartopy
。 My python is installed using macports and when I run: 我的python是使用macports安装的,当我运行时:
sudo pip install cartopy
I get the following error: 我收到以下错误:
/usr/bin/clang -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -pipe -Os -I/opt/local/Library/Frameworks/Python.framework/Versions/3.4/include -I./lib/cartopy -I/opt/local/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c lib/cartopy/trace.cpp -o build/temp.macosx-10.10-x86_64-3.4/lib/cartopy/trace.o
lib/cartopy/trace.cpp:236:10: fatal error: 'geos_c.h' file not found
#include "geos_c.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-hwrcv0a1/cartopy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ytar95bq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-hwrcv0a1/cartopy
Note that I installed the dependencies as noted here and geos_c.h
can be found in /opt/local/include
. 请注意,我已按照此处所述安装了依赖项,并且可以在
/opt/local/include
找到geos_c.h
。 It seems like pip
fails to find this dependency in the macports
tree. 似乎
pip
无法在macports
树中找到此依赖项。
Did anyone experienced this kind of problem? 有没有人遇到过这种问题? How can I fix it?
我该如何解决?
This question was also raised as an issue at https://github.com/SciTools/cartopy/issues/535 . 这个问题在https://github.com/SciTools/cartopy/issues/535上也被提出来。
There was recently a bit of work to improve the pip install cartopy
experience. 最近,有一些工作可以改善
pip install cartopy
体验。 Would you mind trying it again with cartopy v0.12.0. 您介意使用cartopy v0.12.0再次尝试。
See https://github.com/SciTools/cartopy/issues/610 for reference. 请参阅https://github.com/SciTools/cartopy/issues/610以获取参考。
This is to answer the last question from Dror, since I am using macports and "pip install cartopy" failed to find "proj_api.h". 这是为了回答Dror的最后一个问题,因为我使用的是Macports,并且“ pip install cartopy”无法找到“ proj_api.h”。 To solve this:
要解决这个问题:
You need to make sure that the proj port is installed: sudo port install proj
您需要确保已安装proj端口:
sudo port install proj
Help pip to locate the header in "/opt/local/include": CFLAGS="-I/opt/local/include" pip install cartopy
帮助pip在“ / opt / local / include”中找到标题:
CFLAGS="-I/opt/local/include" pip install cartopy
Cheers and HTH 干杯和HTH
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.