无法在 OSX 上构建 Mercurial - 未找到 Python.h

发布于 2024-08-30 03:38:56 字数 872 浏览 6 评论 0原文

根据我读到的内容,我需要 Python-Dev,如何在 OSX 上安装它?

我认为我遇到的问题是,我的 Xcode 没有正确安装,并且我没有应该的路径。

上一个问题:

OSX 上的 gcc 在哪里?我已经安装了 Xcode

是关于我找不到 gcc,现在我找不到 Python.h

我应该将我的 /Developer 目录链接到 /usr/ 中的其他位置吗???

这是我的输出:

$ sudo easy_install mercurial
Password:
Searching for mercurial
Reading http://pypi.python.org/simple/mercurial/
Reading http://www.selenic.com/mercurial
Best match: mercurial 1.5.1
Downloading http://mercurial.selenic.com/release/mercurial-1.5.1.tar.gz
Processing mercurial-1.5.1.tar.gz
Running mercurial-1.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_7RaTq/mercurial-1.5.1/egg-dist-tmp-l7JP3u
mercurial/base85.c:12:20: error: Python.h: No such file or directory
...

提前致谢。

For what I've read I need Python-Dev, how do I install it on OSX?

I think the problem I have, is, my Xcode was not properly installed, and I don't have the paths where I should.

This previous question:

Where is gcc on OSX? I have installed Xcode already

Was about I couldn't find gcc, now I can't find Python.h

Should I just link my /Developer directory to somewhere else in /usr/ ???

This is my output:

$ sudo easy_install mercurial
Password:
Searching for mercurial
Reading http://pypi.python.org/simple/mercurial/
Reading http://www.selenic.com/mercurial
Best match: mercurial 1.5.1
Downloading http://mercurial.selenic.com/release/mercurial-1.5.1.tar.gz
Processing mercurial-1.5.1.tar.gz
Running mercurial-1.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_7RaTq/mercurial-1.5.1/egg-dist-tmp-l7JP3u
mercurial/base85.c:12:20: error: Python.h: No such file or directory
...

Thanks in advance.

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

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

发布评论

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

评论(3

爺獨霸怡葒院 2024-09-06 03:38:56

今天我一整天都在为这个问题苦苦挣扎。

我最终发现了一个 网站< /a> 声称所需要做的就是重新安装 Xcode,或安装最新版本(4.3.2,截至撰写本文时)。

所以我尝试了。但这并没有帮助。不是靠它自己。但后来我更进一步:我启动了 Xcode.app,完成后,我打开了 Xcode..Preferences 菜单项,然后转到“下载”选项卡,并说您要安装“Command Line Tools”

一旦我这样做了,然后重新运行 easy_install (在我的例子中,我试图“easy_install dulwich”来满足 hg-git 依赖性),它能够正确地为我找到 Python.h。

I was struggling with this problem all day today.

I eventually discovered a site that claimed that all one needed to do was to reinstall Xcode, or install the latest version (4.3.2, as of this writing).

So I tried that. It did not help; not on its own. But then I went a step further: I fired up Xcode.app, and once I had done that, I opened the Xcode..Preferences menu item, and then go to the Downloads tab, and say that you want to install the "Command Line Tools"

Once I did that, and then re-ran easy_install (in my case I was trying to "easy_install dulwich" to satisfy a hg-git dependency), it was able to properly find Python.h for me.

那一片橙海, 2024-09-06 03:38:56

可能取决于你拥有的 Mac OSX 版本,我在这些地方有它:

/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h

另外,我相信 Xcode 附带的 python 版本是一个自定义版本,可以与 xcode 很好地配合,但如果你使用另一个版本,你必须跳过一些障碍开发环境。

Might depend on what version of Mac OSX you have, I have it in these spots:

/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h

Also I believe the version of python that comes with Xcode is a custom build that plays well with xcode but you have to jump through some hoops if you use another dev environment.

╰沐子 2024-09-06 03:38:56

您确定要从源代码构建 Mercurial 吗?有可用的二进制包,包括不错的MacHg 附带了捆绑的 Mercurial。

Are you sure you want to build Mercurial from source? There are binary packages available, including the nice MacHg which comes with a bundled Mercurial.

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