V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ectotherm
V2EX  ›  macOS

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

  •  
  •   ectotherm · 2012-02-27 14:40:41 +08:00 · 4580 次点击
    这是一个创建于 4413 天前的主题,其中的信息可能已经有所发展或是发生改变。
    找不着/Developer/usr/bin/clang,请问有没有处理的方法,我写了很多python模块,需要用到distutils/setup.py,有解决方法么?

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

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

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
    sinxccc
        11
    sinxccc  
       2012-03-06 10:22:33 +08:00
    @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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   981 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:26 · PVG 04:26 · LAX 13:26 · JFK 16:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.