gre*_*uan 9 python vim terminal
当我尝试在终端中运行vim时(以便在我的另一个问题中遵循@ romainl的建议)我得到了很多Python错误,这些都归结为:
IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
为什么是这样?我甚至可以使用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)
Run Code Online (Sandbox Code Playgroud)
额外信息:
我在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-错误/
在我的开发机器上安装spf13-vim时遇到了确切的IOError ...
这解决了这个问题:
$ sudo mkdir -p /usr/include/python2.7
$ sudo ln -s /System/Library/Frameworks/Python.framework/Versions/Current/include/python2.7/pyconfig.h /usr/include/python2.7/pyconfig.h
Run Code Online (Sandbox Code Playgroud)
采取从这里.