2012-02-24 116 views
1

我想在我的Mac OS X 10.6上使用TortoiseHg。我下载了最新的TortoiseHg。该MAC来与Python 2.6,但我装2.7:TortoiseHg抱怨说它找不到Python

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] A Python runtime not could be located. You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this application's Info.plist file.

我怎样才能解决这个问题?

+0

尝试将Python解释器添加到您的路径(编辑'.bash_profile'上的'PATH') – 2012-02-24 20:42:17

回答

0

您可以通过键入获取路径到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命令的路径。

相关问题