Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I installed meld in Mac OSX with Homebrew:

brew install meld

Then, when I run meld . it fails with the following error:

Cannot import: pygtk

No module named pygtk

However, pygtk is already installed:

brew install pygtk

Error: pygtk-2.24.0 already installed

share|improve this question

4 Answers 4

The solution was to install PyGTK, directly from the pkg file in the repository:

It worked flawlessly after that.

share|improve this answer
Wow it surely works after that. I first tried installing it through macports but that took so much time and in the end it didn't even work or maybe i couldn't figure out how to run it from terminal. But this options was simple. Thanks! – Rahul Dole Aug 2 '13 at 15:43

This seems to be the missing bit after installing using brew:

export PYTHONPATH=/usr/local/lib/python2.7/site-packages
share|improve this answer
That's not working for me. :( – trusktr Jan 27 at 3:37
Wait nevermind, starting xquartz first, then meld works. – trusktr Jan 27 at 3:39

I found that pygtk is only part of the package. For meld to work you need to install the following:


brew uninstall cairo gtk+ pygobject py2cairo pygtk
brew tap phinze/homebrew-cask
brew install cairo gtk+
brew install py2cairo pygtk
brew install pygobject
brew install meld

Afterwards if you ls "/usr/local/lib/python2.7/site-packages/" you should see this:

Mac-Pro:~ user$ ls -la /usr/local/lib/python2.7/site-packages/ | grep pygtk
lrwxr-xr-x    1 user  admin      84 Mar  3 19:46 -> ../../../Cellar/pygtksourceview/2.10.0/lib/python2.7/site-packages/
lrwxr-xr-x    1 user  admin      70 Mar  5 01:04 pygtk.pth -> ../../../Cellar/pygobject/2.28.6/lib/python2.7/site-packages/pygtk.pth
lrwxr-xr-x    1 user  admin      69 Mar  5 01:04 -> ../../../Cellar/pygobject/2.28.6/lib/python2.7/site-packages/
-r--r--r--    1 user  admin    2075 Mar  5 01:05 pygtk.pyc
lrwxr-xr-x    1 user  admin      70 Mar  5 01:04 pygtk.pyo -> ../../../Cellar/pygobject/2.28.6/lib/python2.7/site-packages/pygtk.pyo

pygobject is actually the library that creates the pygtk library links that meld is looking for, I think the install order is important, as all of these packages were installed and meld failed to start with a missing pygtk library error.

When installed in the above order meld functioned flawlessly on two separate machines running Mavericks 10.9.2 which previously had a full environment setup in which meld reported no pygtk library when started.

I found this worked without needing to set PYTHONPATH, not to say that it isn't a bad idea.

To execute meld, simply open a terminal and execute:


Edit: Added tap cask, install cask, required for cairo to install. Added brew install meld, added execution instruction.

share|improve this answer

I use macport to install meld on my Yosemite OSX 10.10 mac air. I encountered the same problem. @brablc 's method doesn't seem to work for me. Then I found this solution which works for me:

PYTHONPATH=/usr/lib/python2.7 meld &
share|improve this answer
That's not working for me. :( – trusktr Jan 27 at 3:37
Wait nevermind, starting xquartz first, then meld works. – trusktr Jan 27 at 3:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.