简体   繁体   English

融合错误“无法导入:GTK+; DLL 加载失败”作为外部 git difftool 启动 meld.exe 时

[英]Meld error “Cannot import: GTK+; DLL load failed" when launching meld.exe as external git difftool

I'm trying to use Meld as Git Difftool on Windows and was facing following issue:我正在尝试在 Windows 上使用 Meld 作为 Git Difftool 并面临以下问题:

Launch 'meld' [Y/n]? Y
Cannot import: GTK+
DLL load failed: Das angegebene Modul wurde nicht gefunden.

The following Python error occured:出现以下 Python 错误:

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.

The same issue occures when I was trying to run meld.exe in git bash.当我尝试在 git bash 中运行 meld.exe 时出现同样的问题。

To use meld as difftool I changed the settings in user's gitconfig file:要将 meld 用作 difftool,我更改了用户 gitconfig 文件中的设置:

[merge]
    tool = meld
[mergetool "meld"]  
    path = C:\\Program Files (x86)\\Meld\\meld.exe
[diff]
    tool = meld

This seems to be correct because git is trying to launch the meld.exe after using the command 'git difftool' in the workspace.这似乎是正确的,因为 git 在工作区中使用命令 'git difftool' 后试图启动 meld.exe。

Following lib-workaround helped to be able to launch the meld.exe as external git difftool:遵循 lib-workaround 有助于能够将 meld.exe 作为外部 git difftool 启动:

Meld was expecting the certain dll-file called 'libgirepository-1.0-1.dll' in the wrong directory, the file libgirepository-1.0-1.dll needed to be copied from C:\\Program Files (x86)\\Meld\\lib to the directory above C:\\Program Files (x86)\\Meld. Meld 期望某个名为“libgirepository-1.0-1.dll”的 dll 文件位于错误的目录中,需要将文件 libgirepository-1.0-1.dll 从 C:\\Program Files (x86)\\Meld\\lib 复制到C:\\Program Files (x86)\\Meld 上面的目录。

The result is that Meld is starting after the command 'git difftool' and after running the meld.exe in git bash, however, the following error occured:结果是Meld在'git difftool'命令后启动,在git bash中运行meld.exe后,出现如下错误:

2019-09-18 14:12:24,612 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.612: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,612 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.612: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,613 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.613: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,613 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.613: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,613 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.613: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,613 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.613: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,613 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.613: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,613 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.613: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,614 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.614: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,614 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.614: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,615 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.615: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,615 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.615: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,616 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.616: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,616 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.616: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,616 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.616: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,616 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.616: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,616 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.616: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,616 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.616: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,617 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.617: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:24,617 CRITICAL Gtk:
(meld.exe:20432): GLib-GIO-CRITICAL **: 14:12:24.617: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,202 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.201: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,203 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.203: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,203 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.203: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,203 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.203: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,204 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.204: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,204 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.204: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,205 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.205: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,205 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.205: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,205 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.205: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,206 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.206: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,207 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.207: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,499 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.499: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,499 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.499: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,499 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.499: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,499 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.499: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,499 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.499: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,500 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.500: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,500 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.500: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,500 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.500: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,500 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.500: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,500 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.500: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,501 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.501: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,538 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.538: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,540 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.540: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,540 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.540: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,542 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.541: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,542 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.542: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,543 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.543: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,543 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.543: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,543 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.543: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,543 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.543: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,543 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.543: g_content_type_is_a: assertion 'type != NULL' failed
2019-09-18 14:12:26,544 CRITICAL Gtk:
(org.gnome.meld:20432): GLib-GIO-CRITICAL **: 14:12:26.544: g_content_type_is_a: assertion 'type != NULL' failed

Refer to the link for the solution: https://github.com/msys2/MINGW-packages/issues/3673#issuecomment-476861638解决方法参考链接: https : //github.com/msys2/MINGW-packages/issues/3673#issuecomment-476861638

What works for me: copy Meld/lib/libgirepository-1.0-1.dll to one folder up (next to Meld.exe).什么对我有用:将 Meld/lib/libgirepository-1.0-1.dll 复制到一个文件夹(在 Meld.exe 旁边)。

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

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