windows - 安装 Mercurial Activity 扩展的问题

标签 windows mercurial tortoisehg

我使用的是安装了 Mercurial TortoiseHg 的 Windows XP。现在我需要安装外部 activity extension .我下载了扩展程序并在 hgrc 中启用了它。

当我尝试使用命令调用它时:

hg activity

我收到以下错误:

There are 292 changesets
Hg activity options: you need matplotlib in your python path in order to use the hg activity extension.

然后我安装了 python 2.6 和 matplotlib。所以他们的路径是:

  • D:\Python26\
  • D:\Python26\Lib\site-packages\matplotlib

现在我不知道如何告诉 mercurial 事件扩展从那个位置使用 matplotlib?我在 TortoiseHg FAQ 中找到了一些解释,在标题“TortoiseHg 扩展在哪里寻找 Windows 上的外部 Python 模块?”下

但是当我执行那里写的步骤时,我收到与上面相同的错误消息。

最佳答案

我尝试了这种方法,似乎效果很好。

您需要将路径包含在内

import sys
sys.path.append(r'C:\Python26\Lib\site-packages')

另见以下代码@http://bitbucket.org/tortoisehg/stable/src/cf4b3dfd15ee/contrib/hg

# enable importing on demand to reduce startup time
try:
    from mercurial import demandimport; demandimport.enable()
except ImportError:
    sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                     ' '.join(sys.path))
    sys.stderr.write("(check your install and PYTHONPATH)\n")
    sys.exit(-1)

您也应该能够在 PYTHONPATH 环境变量中添加以下路径 (D:\Python26\Lib\site-packages)。

这应该允许与 TortoiseHg 捆绑在一起的 python 查看捆绑目录之外的非标准路径。

关于windows - 安装 Mercurial Activity 扩展的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4052768/

相关文章:

version-control - Mercurial/Kiln 如何在不影响其他文件的情况下获取已删除的文件?

authentication - 如何验证 TortoiseHg Web 服务器上的用户?

Mercurial:更新到修订版,但不修改本地文件

windows - 是否可以在没有管理员权限的情况下在 Windows XP 上运行 Oracle?

android - HAX 正在运行,模拟器在 AVD 和 Android Studio 中以快速 virt 模式运行

eclipse - 在eclipse中用mercurial填充@version标签/关键字替换

mercurial - 在 Mercurial 或 TortoiseHg 中搜索部分文件或路径的更改历史

windows - emacs:可以设置与任务栏不同的框架标题吗? ( Windows )

windows - 通过序列号识别 CD-ROM

version-control - 如何获取按最近使用顺序排列的 Mercurial (hg) 书签列表?