V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ectotherm
V2EX  ›  macOS

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

  •  
  •   ectotherm · Feb 27, 2012 · 5627 views
    This topic created in 5180 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
        1
    sinxccc  
       Feb 27, 2012
    xcode-select -switch /Applications/Xcode.app
    ectotherm
        2
    ectotherm  
    OP
       Feb 27, 2012
    @sinxccc 没用
    ectotherm
        3
    ectotherm  
    OP
       Feb 27, 2012
    @sinxccc 我在4.3上app store的当天晚上从macports mailing list就看到这个方法,然后macports可以工作了,但distutils还是不行

    不会要重现编译python吧
    reeze
        4
    reeze  
       Feb 29, 2012
    @ectotherm 去xcode -> perferences -> Downloads -> Components
    下载个command line tools就好了。
    ectotherm
        5
    ectotherm  
    OP
       Feb 29, 2012
    @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
        6
    ant_sz  
       Feb 29, 2012
    ln -s 正解
    ectotherm
        7
    ectotherm  
    OP
       Feb 29, 2012
    @ant_sz 这个方法我早用了。我想要更优美的办法
    lldong
        8
    lldong  
       Mar 5, 2012
    @ectotherm 或许这样可以
    `sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/`
    ectotherm
        9
    ectotherm  
    OP
       Mar 6, 2012
    @lldong 谢谢我回去试一下,公司还没有升级到lion
    ashchan
        10
    ashchan  
       Mar 6, 2012
    @lldong @ectotherm @sinxccc 正确的 `xcode-select -switch` 用法是:

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
    sinxccc
        11
    sinxccc  
       Mar 6, 2012
    @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   ·   Solana   ·   2506 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 15:11 · PVG 23:11 · LAX 08:11 · JFK 11:11
    ♥ Do have faith in what you're doing.