Python GDAL does not install on Mac OSX El Capitan

半腔热情 提交于 2019-12-04 17:35:57
Salias

I finally (with a little help from Cam_Aust) solved the problem !!!

Here is what I did:

  1. Find the cp_port.h file in your system: sudo find / -name cpl_port.h, My output was:

/Library/Frameworks/GDAL.framework/Versions/1.11/Headers/cpl_port.h /opt/local/include/cpl_port.h

  1. Add the resulting folders to your $PATH in your bash init script (~/.bash_login or ~/.zshrc). This worked for me: export PATH=/Library/Frameworks/GDAL.framework/Headers:$PATH
  2. Open a new terminal session or source ~/.zshrc

After this, you can now pip install gdal:

Collecting gdal 
Using cached GDAL-2.1.0.tar.gz
Installing collected packages: gdal
Running setup.py install for gdal ... done
Successfully installed gdal-2.1.0

After installing the GDAL Libraries from kyngchaos (as mentioned in the question) you should be able to find the python package ready to go.

I cheated and used that:

export PYTHONPATH=$PYTHONPATH:/Library/Frameworks/GDAL.framework/Versions/2.1/Python/2.7/site-packages
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!