找到你的pythonfig.h
的位置,Mac下可以使用命令:
locate pyconfig.h
得到位置:/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h
然后在当前终端中输入(要对应地址):
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/include/python2.7/"
不再出现该错误。