0

I'm trying to run meld on Cygwin, after having installed it, and circumvented the "no module named 'meld'" issue by forcing it to use Python 3.6. Now, I get:

$ meld
Traceback (most recent call last):
  File "/usr/bin/meld", line 341, in <module>
    check_requirements()
  File "/usr/bin/meld", line 193, in check_requirements
    gi.require_version("Gtk", "3.0")
AttributeError: module 'gi' has no attribute 'require_version'

Where do I get gi from, and what do I do to get meld to work?

Version info:

  • Windows: Version 10.0.19045.5131
  • Cygwin: Updated 2024-12-05
  • meld: 3.18.0-1
  • Python3: 3.9.16
  • Python3.6: 3.6.15

I can provide additional information as relevant, just ask in a comment.

8
  • you must have a really old python-gobject installed. I can't rule it out, but I'd be surprised if that's the one shipped with cygwin… anyways, this really is no UNIX/Linux problem. You cannot just "force" python versions for software written for other versions. That's not how that can work out. Clearly, whyever you did that, it's not the solution to your problem, so don't do that. Commented Dec 5, 2024 at 14:44
  • I’m voting to close this question because it's not about Linux or UNIX, but about a problem arising from the specific things the user did to their installation of software on Windows. Commented Dec 5, 2024 at 14:50
  • See Cygwin: Meld. We cannot fix the fact that the maintainer decided to orphan the package. There's also a python36 package and a python3-gi Commented Dec 5, 2024 at 17:38
  • @MarcusMüller: It's a brand-new Cygwin installation. I don't control what's in it... Commented Dec 5, 2024 at 21:27
  • no, it's not "fresh" if you try to force it to use a different python version. Commented Dec 5, 2024 at 21:31

1 Answer 1

4

Issue

While looking up the links for the comment I left, I discovered why the OP is having an issue. I don't know how the OP forced python 3.6 to be used but according to the Meld Website, the minimum requirement is Python 3.4. That can be said like this:

3.4.x <= python <= 3.13.x
3.13 is the current version as of this answer.

The OP is confusing the soft dependency on python36 for Cygwin Package: Meld for a hard dependency, because unfortunately the now long gone maintainer packaged the file incorrectly by not using the meta python package as the dependency. The issue is further compounded by the dependency for Cygwin Package: python3-gi, which is a meta-package currently filled by Cygwin Package: python39-gi. <=== This was packaged correctly using the python meta-package as a dependency.

This error:

File "/usr/bin/meld", line 193, in check_requirements
    gi.require_version("Gtk", "3.0")

is occurring because the minimum value for the gi bits is 3.9 which isn't the 3.6 in the dependency graph for meld Fix this by:

  1. Removing all versions of python using the Cygwin Installer
  2. Install the meta-package python which will install the default Cygwin Python which is currently 3.9
    • This should perform version matching for all packages required by python39, one of which may be GTK-3.x. I can't tell if gi is failing because the minimum Python is 3.9 or if GTK is failing because the version is < 3.
  3. Reinstall meld
  4. Per comment below: cd /usr/lib/python3.6/ && mv -Rv ./site-packages/* /usr/lib/python3.9/site-packages/

Marcus and I both agree that 3.9 is a bit old for Python, but that's the trade-off when using a toolset (Cygwin) that is just a DLL bridge for Windows.

4
  • Note that all version of python are only versions added as Cygwin packages, I did not install anything manually. Also, won't this just get me back to this bug? Commented Dec 5, 2024 at 21:35
  • @einpoklum The fact that the python site-packages directory is hardcoded as python 3.6 is not an issue with meld. The issue is how the package was packaged. If you move /usr/lib/python3.6/* to usr/lib/python3.9/ you'll fix the issue, as you cannot force the gi bits to use 3.6. Your other problem is that the Cygwin version of meld has no maintainer, so you cannot report that the package needs an update. Commented Dec 5, 2024 at 22:22
  • @einpoklum Consider authoring an e-mail to the Cygwin-apps mailing list. Report that the meld package has no maintainer and should be added to the maintainer that packages GNOME and its apps and libraries. Refer them to this question if they reply with a why? Commented Dec 5, 2024 at 22:56
  • I'll follow your advice when I'm back at the office next week and report back. For now, +1 for being helpfully actionable... Commented Dec 6, 2024 at 9:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.