我正在尝试使用自制软件在运行 Big Sur 的新 MacBook Pro 上安装 Cartopy。我已完成以下操作:
这失败了,因为它找不到 proj_api.h。手动将 CFLAGS 设置为 I/Library/Frameworks/PROJ.framework/Headers(其中只有我能找到的 proj_api.h 副本)后,安装成功。但是……当我尝试在 python 脚本中导入 cartopy 时,出现以下错误:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cartopy/__init__.py", line 104, in <module>
import cartopy.crs
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cartopy/crs.py", line 22, in <module>
from cartopy._crs import (CRS, Geodetic, Globe, PROJ4_VERSION,
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cartopy/_crs.cpython-39-darwin.so, 2): Symbol not found: _pj_free
Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cartopy/_crs.cpython-39-darwin.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cartopy/_crs.cpython-39-darwin.so
有没有人知道我可能做错了什么(除了没有使用 conda 开始)?