1
Traceback (most recent call last):   File "./Scripts/version.py", line 6, in <module>
    from Foundation import NSMutableDictionary   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Foundation/__init__.py", line 8, in <module>
    import objc as _objc   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/__init__.py", line 30, in <module>
    from objc._bridgesupport import *   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 9, in <module>
    import pkg_resources   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 698, in <module>
    class Environment(object):   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 701, in Environment
    def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 96, in get_supported_platform
    plat = get_build_platform(); m = macosVersionString.match(plat)   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 222, in get_build_platform
    plat = get_platform()   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/util.py", line 98, in get_platform   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/sysconfig.py", line 498, in get_config_vars   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/sysconfig.py", line 407, in _init_posix distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.7" but "10.8" during configure Command /bin/sh failed with exit code 1

我正在使用 python 脚本对 TestFlight 进行版本控制。在构建时我遇到了一些错误。我对python一无所知。这里有什么问题?

  • XCode 版本:4.4
  • 操作系统:山狮 10.8
  • MacBook PRO 2009 年中
4

3 回答 3

1

这似乎是消息的关键部分:

$MACOSX_DEPLOYMENT_TARGET 不匹配:在配置期间现在为“10.7”但为“10.8”

您使用的任何工具集都是在 Mountain Lion 下配置的,但现在在 Lion 下运行,而您却声称相反。

您没有指定您使用的工具集,但看起来您将不得不在新的操作系统下重新设置它。

于 2012-07-30T09:05:29.333 回答
1

这有点奇怪,但是如果您编辑 .bash_profile 并添加:

导出 MACOSX_DEPLOYMENT_TARGET=10.8

你应该没事的。尝试运行后审查时,我遇到了同样的问题。

于 2012-08-30T16:20:01.397 回答
0

我找到了解决方案,进入您的 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/distutils/sysconfig.py

转到显示“引发 DistutilsPlatformError”的第 408 行并添加一个“#”以注释掉该行代码......这将“释放 python”

您基本上是在告诉 python“别担心它不是 10.7,我知道”可能会导致一些崩溃,但我认为并非如此。我非常复杂的 python 应用程序现在可以在 MacOSX 10.8 上毫无问题地编译,而且它似乎可以完成这项工作,但 QA 仍然需要对其进行测试。

我在 MacBookPro 2012 MacOSX 10.8

于 2012-11-09T21:10:11.170 回答