Mercurial SCM (hg) fix for OS X 10.7 Lion

July 21st, 2011 0 Comments

After up­grad­ing to Mac OS X 10.7 (Lion), The com­mand line tool hg seemed not to work any longer:
xxxxxx:~ $ hg
abort: couldn’t find mercurial libraries in [
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/ /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
(check your install and PYTHONPATH)

In­deed, up­dated paths to the Python frame­works in 10.7 are the cause. To fix the prob­lem until a ver­sion of Mer­cu­r­ial for 10.7 is re­leased:

Re-in­stall Mer­cu­r­ial for OS X 10.6 from http://​mercurial.​selenic.​com/​downloads/​
Open the file /usr/local/bin/hg:
sudo vim /usr/local/bin/hg
Re­place the line
libdir = ‘../../platlib/Library/Python/2.6/site-packages/’
with libdir = ‘/Library/Python/2.6/site-packages’

Mer­cu­r­ial’s hg should now work again as ex­pected.

Up­date (July 17, 2011): There is a ver­sion of Mer­cu­r­ial for 10.7 now. Click the link below to install:
Mer­cu­r­ial 1.9 for MacOS X 10.7