Can't install mercurial on Mac OS X 10.7

Matt Mackall mpm at selenic.com
Wed Aug 24 15:25:18 UTC 2011


On Tue, 2011-08-23 at 17:50 +0200, Leendert Botha wrote:
> I am trying to install Mercurial on mac. I've tried installing from source, using easy_install and using macports. Every time I get the following error when running 'hg':
> 
>   File "/usr/local/bin/hg", line 38, in <module>
>     mercurial.dispatch.run()
>   File "/usr/local/lib/python2.6/site-packages/mercurial/dispatch.py", line 27, in run
>     sys.exit(dispatch(request(sys.argv[1:])))
>   File "/usr/local/lib/python2.6/site-packages/mercurial/dispatch.py", line 40, in dispatch
>     req.ui = uimod.ui()
>   File "/usr/local/lib/python2.6/site-packages/mercurial/ui.py", line 43, in __init__
>     for f in scmutil.rcpath():
>   File "/usr/local/lib/python2.6/site-packages/mercurial/scmutil.py", line 399, in rcpath
>     _rcpath = osrcpath()
>   File "/usr/local/lib/python2.6/site-packages/mercurial/scmutil.py", line 371, in osrcpath
>     path = systemrcpath()
>   File "/usr/local/lib/python2.6/site-packages/mercurial/scmutil.py", line 420, in systemrcpath
>     path.extend(rcfiles(os.path.join(p, 'etc/mercurial')))
>   File "/usr/local/lib/python2.6/site-packages/mercurial/scmutil.py", line 409, in rcfiles
>     for f, kind in osutil.listdir(rcdir)
>   File "/usr/local/lib/python2.6/site-packages/mercurial/demandimport.py", line 75, in __getattribute__
>     self._load()
>   File "/usr/local/lib/python2.6/site-packages/mercurial/demandimport.py", line 47, in _load
>     mod = _origimport(head, globals, locals)
> ImportError: dynamic module does not define init function (initosutil)

Sounds like your osutil module is getting miscompiled or you've got a
version mismatch. Things changed here between OS X 10.6 and 10.7. For
starters, the stock Python is now 2.7, while the above is talking about
2.6.

Make sure you've thoroughly purged any and all(!) existing Mercurial
installs before trying to compile your own. We have frequent reports
from Mac users installing Mercurial from different sources and getting
into trouble because they've got installs they don't know about.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list