python easy_install 失败并显示“未安装架构 ppc 的汇编程序”在 Mac OS X 上

发布于 2024-10-20 22:25:11 字数 990 浏览 2 评论 0原文

bash-3.2$ sudo easy_install appscript  
Password:  
Searching for appscript  
Reading http://pypi.python.org/simple/appscript/  
Reading http://appscript.sourceforge.net  
Best match: appscript 1.0.0  
Downloading http://pypi.python.org/packages/source/a/appscript/appscript-1.0.0.tar.gz#md5=6619b637037ea0f391f45870c13ae38a  
Processing appscript-1.0.0.tar.gz  
Running appscript-1.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-C4d1az/appscript-1.0.0/egg-dist-tmp-yVTHww  
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed  
Installed assemblers are:  
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64  
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386  

我在这方面是个菜鸟(我已经学会了使用 python 和 unix,但我从来没有处理过安装问题。)早些时候我收到了一个与 gcc-4.2 未找到相关的错误,我发现一些帖子建议重新安装 XCode。我选择了 4.0(糟糕的选择?),现在我明白了。我现在不知道该怎么办。

bash-3.2$ sudo easy_install appscript  
Password:  
Searching for appscript  
Reading http://pypi.python.org/simple/appscript/  
Reading http://appscript.sourceforge.net  
Best match: appscript 1.0.0  
Downloading http://pypi.python.org/packages/source/a/appscript/appscript-1.0.0.tar.gz#md5=6619b637037ea0f391f45870c13ae38a  
Processing appscript-1.0.0.tar.gz  
Running appscript-1.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-C4d1az/appscript-1.0.0/egg-dist-tmp-yVTHww  
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed  
Installed assemblers are:  
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64  
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386  

I'm a pretty big noob at this stuff (I've learned to use python and unix a bit, but I've never had to deal with installation.) Earlier I was getting an error related to gcc-4.2 not being found, and I found some posts that recommended reinstalling XCode. I went with 4.0 (bad choice?) and now I get this. I've got no idea what to do at this point.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

情释 2024-10-27 22:25:11

升级到 XCode 4 后,我就发生了这种情况;我没有时间弄清楚升级过程中出了什么问题(或者这是否是预期的行为),但以下解决方法对我有用:

sudo env ARCHFLAGS="-arch i386" easy_install whatever

ARCHFLAGS 技巧与 setup 一起使用。 py 以及:

env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py install

This happened for me after having upgraded to XCode 4; I haven't had time to figure out what went wrong during the upgrade (or whether this is the intended behaviour), but the following workaround works for me:

sudo env ARCHFLAGS="-arch i386" easy_install whatever

The ARCHFLAGS trick works with setup.py as well:

env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py install
心奴独伤 2024-10-27 22:25:11

我找到了另一个解决方案这里它解决了问题一劳永逸。事实证明 XCode4 仍然有 ppc 汇编器。你只需要在正确的位置有一个指向它的符号链接:

$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /Developer/usr/libexec/gcc/darwin
$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /usr/libexec/gcc/darwin

为我解决了在 Snow Leopard 上安装 XCode4 的问题。

编辑:我尝试了其他解决方案,这些解决方案在某些情况下有效,但总是遇到一个在某处硬编码 PPC 要求的包。提供PPC汇编器一劳永逸地解决了所有这些问题。

I found another solution here which solves the problem once and for all. It turns out XCode4 still has the ppc assembler. You just need a symlink to it in the right place:

$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /Developer/usr/libexec/gcc/darwin
$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /usr/libexec/gcc/darwin

Fixed the problem for me with XCode4 installed on Snow Leopard.

EDIT: I tried other solutions, which worked in some cases, but invariably encountered a package that hardcoded the PPC requirement somewhere. Providing the PPC assembler got rid of all these problems once and for all.

是你 2024-10-27 22:25:11

对我来说,关键是 ppc 汇编器,而不是 ARCHFLAGS 的东西。但是,上面的建议并没有奏效;我在这些位置没有这些文件。但经过一些修补和探索,我发现我确实在 /usr/bin/as 处有 ppc 组件。我第一次尝试 sudo ln -s /usr/bin/as /usr/libexec/as/ppc/as ,但是失败了(关于无法分叉进程的事情......?)。所以我最终只是做了 sudo cp /usr/bin/as /usr/libexec/as/ppc/as ,并且成功了(我想我必须做一些 sudo mkdir ) code> 也沿着这条路径)。

For me, the key was the ppc assembler, not the ARCHFLAGS stuff. But, the suggestion above didn't work; I didn't have the files in those locations. But with some tinkering and poking around, I found that I did have the ppc assember at /usr/bin/as. I first tried sudo ln -s /usr/bin/as /usr/libexec/as/ppc/as, but that failed (something about could not fork process...??). So I ended up just doing sudo cp /usr/bin/as /usr/libexec/as/ppc/as, and that worked (I think I had to do some sudo mkdirs along that path, as well).

温柔戏命师 2024-10-27 22:25:11

在 Mac OS X 10.6 上使用系统 Python,您需要安装 Apple Xcode 开发人员工具中的 gcc-4.2 来构建扩展模块,就像使用 Appscript 一样。其他产品可能需要 Xcode gcc-4.0,因此您应该同时安装它们。他们共存得很好。

Using the system Pythons on Mac OS X 10.6, you'll need to have the gcc-4.2 from the Apple Xcode Developer Tools installed to build extension modules, like with Appscript. Other products may need the Xcode gcc-4.0 so you should install them both. They co-exist just fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文