Git运行Meld作为合并工具失败'check_requirements import gi'

7
合并冲突文件时出错: Error while trying to merge conflicting files 我使用git作为版本控制工具,并调用Meld来合并冲突文件(IDE使用Qt creator,但我不认为它会是问题所在)。我不明白为什么合并过程失败了,因为在不同的时间里,该过程被用于合并项目(远程和本地)。
3个回答

9

除了无法找到GTK DLL外,gi模块可以正常运行:

---------------------------
cx_Freeze: Python error in main script
---------------------------
Traceback (most recent call last):
  File "bin/meld", line 205, in check_requirements
    import gi
  File "C:/msys64/MINGW32/lib/python3.7/site-packages/gi/__init__.py", line 42, in <module>
  File "ExtensionLoader_gi__gi.py", line 23, in <module>
  File "ExtensionLoader_gi__gi.py", line 15, in __bootstrap__
  File "C:/msys64/MINGW32/lib/python3.7/imp.py", line 342, in load_dynamic
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/msys64/MINGW32/lib/python3.7/site-packages\cx_Freeze/initscripts/__startup__.py", line 14, in run
  File "C:/msys64/MINGW32/lib/python3.7/site-packages\cx_Freeze/initscripts/Console.py", line 26, in run
  File "bin/meld", line 362, in <module>
    check_requirements()
  File "bin/meld", line 211, in check_requirements
    missing_reqs("GTK+", gtk_requirement, e)
  File "bin/meld", line 194, in missing_reqs
    show_error_and_exit(_("Cannot import: ") + mod + "\n" + str(exc))
  File "bin/meld", line 182, in show_error_and_exit
    raise Exception(error_text)
Exception: Cannot import: GTK+
DLL load failed: The specified module could not be found.

---------------------------
OK   
---------------------------

我已将C:\Program Files (x86)\Meld\lib添加到我的Path 用户环境变量中,现在 Meld 可以正常工作。


4

我使用以下命令将 meld 设置为我的比较工具:

git config --global diff.tool meld
git config --global difftool.prompt false

我也遇到了同样的错误信息。

我花了一些时间才找到了https://gitlab.gnome.org/GNOME/meld/issues/282,Wesley Staples在其中提供了一个非常有用的解决方法:

一个临时的解决方法是将 "C:\Program Files (x86)\Meld\lib\libgirepository-1.0-1.dll" 复制到 "C:\Program Files (x86)\Meld\libgirepository-1.0-1.dll"。将其复制到上一级目录。


1
我能提供的解决方案如下:

复制"C:\Program Files (x86)\Meld\lib\libgirepository-1.0-1.dll"到"C:\Program Files (x86)\Meld\libgirepository-1.0-1.dll"。


1
请不要忘记引用来源。这是您自己解决的问题,还是在这里得到了 Wesley Staples 的帮助?https://gitlab.gnome.org/GNOME/meld/issues/282 - Gabriel Staples

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接