当我尝试在终端中运行 vim 时(以便在我的另一个问题中遵循@romainl 的建议),我得到了很多 Python 错误,这些错误都归结为:
IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)
为什么是这样?我什至可以使用 Python 或 Sublime Text,没有任何问题。
完整的错误列表如下:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 565, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 547, in main
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 278, in addusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 253, in getusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getuserbase
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 523, in get_config_var
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 419, in get_config_vars
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 298, in _init_posix
IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)
额外信息:
我使用的是 Mac OS X Mountain Lion (OS 10.8)
编辑:
我尝试了@BobDunakey 的想法但没有成功,这个想法是使用sudo
. 我仍然得到同样的错误。
编辑 2:
由于 Zirak 的解决方案,我能够解决问题,如下所示:http ://clearfix.be/2012/08/05/fix-mountain-lion-10-8-python-ioerror-pyconfig- h-错误/