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

2012-02-27 14:40:41 +08:00
 ectotherm
找不着/Developer/usr/bin/clang,请问有没有处理的方法,我写了很多python模块,需要用到distutils/setup.py,有解决方法么?

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

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

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/28259

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX