【问题标题】:TortoiseHg complains that it can't find PythonTortoiseHg 抱怨找不到 Python
【发布时间】:2012-02-24 19:55:10
【问题描述】:

我正在尝试在我的 Mac OS X 10.6 上使用 TortoiseHg。我下载了最新的 TortoiseHg。 mac自带的是Python 2.6,但我安装的是2.7:

ftwomfg-63-12:~ muffins$ python
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

当我尝试启动 TortoiseHg 时,我收到以下错误:

thg[18006] 找不到 Python 运行时。你可能需要 安装 Python 的框架构建,或编辑 PyRuntimeLocations 此应用程序的 Info.plist 文件中的数组。

我该如何解决这个问题?

【问题讨论】:

  • 尝试将 Python 解释器添加到您的路径(编辑 PATH on .bash_profile

标签: python mercurial tortoisehg


【解决方案1】:

您可以通过输入以下内容获取 Python 的路径:

which python

可能会返回如下内容:

/Library/Frameworks/Python.framework/Versions/2.7/bin/Python

接下来,您需要在 TortoiseHg.app/Contents 目录中编辑 Info.plist 文件。在文件中,您会看到如下内容:

<key>PyRuntimeLocations</key>
<array>
    <string>@executable_path/../Frameworks/Python.framework/Versions/2.7/Python</string>
    <string>/System/Library/Frameworks/Python.framework/Versions/2.7/Python</string>
</array>

您需要将第二个字符串的内容更改为上面 which 命令的路径。

【讨论】:

    猜你喜欢
    • 2022-12-28
    • 2016-07-08
    • 2010-09-12
    • 2018-10-08
    • 2020-06-22
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    • 2020-11-12
    相关资源
    最近更新 更多