Git running Meld as merge tool fails 'check_requirements import gi'

六月ゝ 毕业季﹏ 提交于 2019-12-07 17:45:39

问题


Error while trying to merge conflicting files:

As version control I use git and I call Meld in order to merge conflicting files. (As IDE I use Qt creator, but I do not think it can be the problem). I do not understand why the merge procedure fails, because different times this procedure was used in order to merge the projects (the remote and the local one).


回答1:


The gi module runs, except it fails to find the GTK DLL:

---------------------------
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   
---------------------------

I've added C:\Program Files (x86)\Meld\lib to my Path user environment variable, and now Meld works fine.




回答2:


I set meld as my difftool by executing

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

and I got the same error message.

It took me a while to find https://gitlab.gnome.org/GNOME/meld/issues/282 where Wesley Staples gives a very helpful work-around:

A temporary workaround is to copy "C:\Program Files (x86)\Meld\lib\libgirepository-1.0-1.dll" to "C:\Program Files (x86)\Meld\libgirepository-1.0-1.dll". Copy it up one directory.



来源:https://stackoverflow.com/questions/55123873/git-running-meld-as-merge-tool-fails-check-requirements-import-gi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!