繁体   English   中英

TortoiseHg抱怨找不到Python

[英]TortoiseHg complains that it can't find Python

我试图在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的框架版本,或在此应用程序的Info.plist文件中编辑PyRuntimeLocations数组。

如何解决此问题?

您可以通过输入以下内容来获取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命令的路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM