ectotherm
V2EX  ›  macOS

自从升级到Xcode 4.3,python distutils工作不正常了

  •  
  •   ectotherm · Feb 27, 2012 · 6157 views
    This topic created in 5364 days ago, the information mentioned may be changed or developed.
    找不着/Developer/usr/bin/clang,请问有没有处理的方法,我写了很多python模块,需要用到distutils/setup.py,有解决方法么?

    别告诉我把Xcode.app中的某过目录给ln出来的方法。
    11 replies  •  1970-01-01 08:00:00 +08:00
    sinxccc
    sinxccc
    Feb 27, 2012
    1
    xcode-select -switch /Applications/Xcode.app
    ectotherm
    ectotherm
    OP
    Feb 27, 2012
    2
    @sinxccc 没用
    ectotherm
    ectotherm
    OP
    Feb 27, 2012
    3
    @sinxccc 我在4.3上app store的当天晚上从macports mailing list就看到这个方法,然后macports可以工作了,但distutils还是不行

    不会要重现编译python吧
    reeze
    reeze
    Feb 29, 2012
    4
    @ectotherm 去xcode -> perferences -> Downloads -> Components
    下载个command line tools就好了。
    ectotherm
    ectotherm
    OP
    Feb 29, 2012
    5
    @reeze 这个当然已经装了,跟distutils安装没有关系。distutils只认/Developer/usr/bin/clang,直接把Xcode.app/Contents/.../usr/bin直接ln出来就可以了,但是我想找找看还有没有更优美的做法。

    比如之前macports 2.03不能用xcode 4.3工作,但升级到svn macports 2.19就可以了。我要的是这样的方法。
    ant_sz
    ant_sz
    Feb 29, 2012
    6
    ln -s 正解
    ectotherm
    ectotherm
    OP
    Feb 29, 2012
    7
    @ant_sz 这个方法我早用了。我想要更优美的办法
    lldong
    lldong
    Mar 5, 2012
    8
    @ectotherm 或许这样可以
    `sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/`
    ectotherm
    ectotherm
    OP
    Mar 6, 2012
    9
    @lldong 谢谢我回去试一下,公司还没有升级到lion
    ashchan
    ashchan
    Mar 6, 2012
    10
    @lldong @ectotherm @sinxccc 正确的 `xcode-select -switch` 用法是:

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
    sinxccc
    sinxccc
    Mar 6, 2012
    11
    @ashchan "xcode-select -switch /Applications/Xcode.app" 的写法是 manpage 里的 example,而且这样设置之后用 "xcode-select -print-path" 看到的路径也已经是 "/Applications/Xcode.app/Contents/Developer" 了。

    % sudo xcode-select -switch /Applications/Xcode.app
    Password:
    % xcode-select -print-path
    /Applications/Xcode.app/Contents/Developer
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2934 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 10:59 · PVG 18:59 · LAX 02:59 · JFK 05:59
    ♥ Do have faith in what you're doing.