苹果对Python框架做了什么? [英] What did Apple do to the Python framework?

查看:117
本文介绍了苹果对Python框架做了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[tl; dr?见底]

OS X上的Python一直令人讨厌,因为它可以拆分并散布到整个系统中.某些在/usr中,某些在/Library/Python中,某些/System/Library/Frameworks/Python.framework.

Python on OS X has always been somewhat of an abomination in that it's split up and spread out all across the system. Some in /usr, some in /Library/Python, some /System/Library/Frameworks/Python.framework.

现在,据我所知,该框架应该包含Python的发行版,即不会改变的点点滴滴.例如标头,标准库,二进制映像等.

Now, as I understand it, the framework is supposed to contain the Python distribution, i.e. the bits and pieces that aren't going to change. An example would be headers, the standard library, the binary images, etc.

因此,作为最受欢迎的Python C扩展的开发人员,我认为自己精通OS X生态系统以及如何在其上编译Python扩展.不到一个月前, Apple决定跳过质量检查,从而破坏了C扩展程序的建立全面.

So as a developer of a sort-of-popular Python C extension, I think myself to be pretty good at the OS X ecosystem and how to compile Python extensions on it. It wasn't a month ago that Apple decided to skip on QA, breaking C extension building across the board.

它以一种新的方式被打破了,因为苹果似乎决定删除Python发行版的更好部分.看一下include/目录:

It's broken in yet a new way though, as Apple seem to have decided to remove the better part of the Python distribution. Take a look at the include/ directory:

$ ls -l /System/Library/Frameworks/Python.framework/Versions/Current/include/python2.6 
total 16
-rw-r--r--  1 root  wheel    30K Jun 25  2010 pyconfig.h

缺少什么? Python.h标头也许是?而且,我对zc.buildout感到困扰,因为找不到site.py....看看:

Missing something? The Python.h header perhaps? What's more, I had woes with zc.buildout because it couldn't find site.py... Have a look-see:

$ python -c 'print __import__("site").__file__'
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.pyc

$ ls -l /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.py*
-rw-r--r--  1 root  wheel    20K May 17 15:40 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.pyc

缺少什么?也许是site.py原作?

Missing something? The site.py original perhaps?

总而言之,看来苹果公司正在剥夺 vital 开发人员资源.我在其他装有OS X 10.6.7的MacBook上证实了这两个发现.

All in all, it seems Apple are stripping out vital developer resources. I confirmed both of these findings on other MacBooks with OS X 10.6.7.

tl; dr 苹果已经从Python框架中删除了许多重要的标头和源代码.还有其他人发生过吗?如果是这样,什么时候发生?为什么会发生呢?最重要的是,我如何找回他们?

tl;dr Apple have removed lots of vital headers and source-code from the Python framework. Has this happened anybody else? If so, when did this happen? Why did it happen? And most importantly, how do I get them back?

推荐答案

Python.h和其他标头包含在Xcode中.在我的系统上,它同时位于/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h中.后者似乎是由Xcode安装程序安装的.

Python.h and other headers are included with Xcode. On my system, it's located in both /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h and /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h. The latter appears to be installed by the Xcode installer.

这篇关于苹果对Python框架做了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆