我正在尝试让 hg-git 扩展与 TortoiseHg(Win10 上的 v5.8)一起使用。我在设置中启用了“hggit”扩展。但是当我尝试推送到 github 时出现错误:
*** failed to import extension hggit: No module named hggit
搜索我的驱动器时,我只有 TortoiseHg 目录中的 hg 可执行文件,但找不到任何 hggit 或 hg-git 二进制文件。是否还需要做其他事情才能使扩展正常工作?
最佳答案
显然目前 THG 可以选择在设置中包含 hggit,但实际上并没有打包 hggit 本身。
According to Matt Harbison , TortoiseHG 的贡献者/维护者之一:
I took [hggit] out because it was always lagging behind changes in core hg, and its dependencies broke stuff.
他接着补充说:
install by simply running
py -2 -m pip install hg-git --user
if you have python2 installed on your system.
另一个人 (Aurélien Campéas) states the following使用 Python 3:
with python 3 and a plain "pip install mercurial hg-git" and it just works
此外,Keith Turkowski 的另一篇文章 describes a full installation THG 和 hggit 在 Windows 上使用 Python3:
Install python-3.9.2-amd64.exe (if you want to use Python 3 and have Python.exe in the path)
Install putty-0.74-installer.msi (for SSH support)
Install tortoisehg-5.7.0-x64.msi
Install python-2.7.18.amd64.msi (For current user, Python.exe not in path)
Win+R ->
cmd
(command prompt):py -2 -m pip install hg-git --user
Enable hggit in TortoiseHg Settings (Extensions)
我假设您可以使用更新版本的 THG、Python 等安装程序。
关于python - TortoiseHg (Mercurial) 找不到 hggit 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67859068/