Mac/Django 错误消息:“/mercurial/osutil.so:没有合适的 64 位架构”

发布于 2024-08-15 23:05:08 字数 510 浏览 3 评论 0原文

我是 Mac 新手(对 Django 也很陌生),我正在新的 Macbook Pro 上设置一个现有的 Django/MySQL 站点,该站点使用 Mercurial 作为站点包。

安装过程中一切顺利 - 没有错误消息。我从 macports 安装了大多数软件包的默认版本。

但是,当我尝试 runserver 时,本地主机显示以下错误消息:

ImportError at /
.../lib/python2.6/site-packages/mercurial/osutil.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)

请问有人可以建议吗?我尝试在终端输入以下内容:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

但没有帮助。

I'm new to Macs (and quite new to Django) and I'm setting up an existing Django/MySQL site that uses Mercurial as a site package, on a new Macbook Pro.

All was going well during installation - no error messages. I installed the default versions of most packages from macports.

However when I try runserver, localhost shows the following error message:

ImportError at /
.../lib/python2.6/site-packages/mercurial/osutil.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)

Please could anyone advise? I've tried typing the following at the terminal:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

but it didn't help.

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

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

发布评论

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

评论(2

心意如水 2024-08-22 23:05:08

我也遇到过类似的错误,两个因素的结合帮助我安装了适用于 OS X Lion 的 Mercurial。我运行的是 OS X 10.7.3。

首先,setup.py 脚本的第 455 行有一个错误(至少对于 Mercurial 2.2.1,我尝试过的版本)。线路

version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()

应替换为

版本 = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0]

其次,在我安装 Mercurial 之后(通过 easy_install、Mac OS X 二进制安装程序和编译),我不断收到出现以下错误消息:

导入错误:dlopen(/Library/Python/2.7/site-packages/mercurial/osutil.so,2):找不到合适的图像。确实找到:/Library/Python/2.7/site-packages/mercurial/osutil.so:mach-o,但架构错误

但是,在看到这篇文章后,我注意到

默认读取 com.apple.versioner.python Prefer-32-Bit

在我的系统上 输出 1。但是,运行这个命令

默认写入 com.apple.versioner.python Prefer-32-Bit -bool no

然后重新编译/安装 Mercurial 最终为我提供了一个工作可执行文件。

I've gotten a similar error and a combination of two things helped me install Mercurial for OS X Lion. I'm running OS X 10.7.3.

First, there is a bug on line 455 of the setup.py script (at least for Mercurial 2.2.1, the version I tried). The line

version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()

should be replaced with

version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0]

Second, after I installed Mercurial (either by easy_install, Mac OS X binary installer, and compilation), I kept getting the following error message:

ImportError: dlopen(/Library/Python/2.7/site-packages/mercurial/osutil.so, 2): no suitable image found. Did find: /Library/Python/2.7/site-packages/mercurial/osutil.so: mach-o, but wrong architecture

However, after seeing this post, I noticed that

defaults read com.apple.versioner.python Prefer-32-Bit

outputs 1 on my system. However, running this command

defaults write com.apple.versioner.python Prefer-32-Bit -bool no

and then recompiling / installing mercurial resulted in a working executable for me at the end.

悸初 2024-08-22 23:05:08

如果我的评论中的所有内容均已通过,请尝试在用户环境变量中而不是在命令行中设置 Prefer-32-bit 。

编辑此文件:~/.MacOSX/environment.plist

请参阅:

http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html#//apple_ref/doc/ uid/20002093-113982

If everything from my comment checks out, try setting that Prefer-32-bit in an user environment variable instead of at the command line.

Edit this file: ~/.MacOSX/environment.plist

See:

http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html#//apple_ref/doc/uid/20002093-113982

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