views:

372

answers:

1

I've got a nasty feeling this is something to do with using 32-bit Python and/or 64-bit Mercurial, but I'm new to Macs and I don't fully understand the background.

I'm running Django and I've got Mercurial and Python 2.6 installed (in both cases, the default versions from Macports). I've set 32-bit Python as an environment variable:

export VERSIONER_PYTHON_PREFER_32_BIT=yes

since without it, Mercurial refused to run and said "no suitable 64-bit architecture".

When I try to run Django (or Mercurial) I get

ImportError at /
dlopen(/lib/python2.6/site-packages/mercurial/osutil.so, 2): no suitable image found.  Did find:
    /lib/python2.6/site-packages/mercurial/osutil.so: no matching architecture in universal wrapper

Google isn't much help here. What's going on? Should I reinstall a different version of Mercurial, and if so, what exactly do I need?

Thanks in advance. Very puzzled.

A: 

I installed 32-bit Enthought Python Distribution, then installed mercurial and get a similar error:

>  hg
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 25, in <module>
    mercurial.util.set_binary(fp)
  File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 75, in __getattribute__
    self._load()
  File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 47, in _load
    mod = _origimport(head, globals, locals)
  File "/Library/Python/2.6/site-packages/mercurial/util.py", line 16, in <module>
    from i18n import _
  File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 106, in _demandimport
    mod = _origimport(name, globals, locals)
  File "/Library/Python/2.6/site-packages/mercurial/i18n.py", line 23, in <module>
    t = gettext.translation('hg', localedir, fallback=True)
  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/gettext.py", line 465, in translation
    mofiles = find(domain, localedir, languages, all=1)
  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/gettext.py", line 437, in find
    for nelang in _expand_lang(lang):
  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/gettext.py", line 131, in _expand_lang
    from locale import normalize
  File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 85, in _demandimport
    return _origimport(name, globals, locals, fromlist)
  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/locale.py", line 98, in <module>
    @functools.wraps(_localeconv)
  File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 75, in __getattribute__
    self._load()
  File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 47, in _load
    mod = _origimport(head, globals, locals)
  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/functools.py", line 10, in <module>
    from _functools import partial, reduce
  File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 106, in _demandimport
    mod = _origimport(name, globals, locals)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/lib-dynload/_functools.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/lib-dynload/_functools.so: mach-o, but wrong architecture