MacOSX compile problems
Matt Mackall
mpm at selenic.com
Sat Jan 17 13:08:31 CST 2009
On Sat, 2009-01-17 at 19:35 +0100, Bastian Doetsch wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Am 17.01.2009 um 19:29 schrieb Matt Mackall:
>
> > On Sat, 2009-01-17 at 19:07 +0100, Bastian Doetsch wrote:
> >> The same: "version unknown". I guess the import error is the reason,
> >> but I don't understand why it happens.
> >>
> >> $ sudo make install-bin
> >> python setup.py build
> >> Traceback (most recent call last):
> >> File "/usr/local/bin/hg", line 11, in <module>
> >> from mercurial import demandimport; demandimport.enable()
> >> ImportError: No module named mercurial
> >
> > This is running your already not-quite-correctly-installed hg, which
> > isn't finding its libraries. You need to either set PYTHONPATH to
> > include /usr/local/python<mumble> (OSX default Python install has dumb
> > defaults) or override PREFIX in the Makefile:
> >
> > make PREFIX=/usr/
> >
> > Because the make process calls hg for version info, you may need to
> > run
> > it twice to get the version info to stick.
>
> It doesn't work either
It? I gave you two different options.
> PYTHONPATH=/usr/local/lib/python2.6/site-packages:/usr/local/lib/
> python2.5/site-packages
>
> Should I really add /usr/local/python2.6/... or was the missing "lib"
> an omission?
Well it's not an arbitrary string, it's the location of the installed
mercurial/ directory. Double-check against 'ls'.
The usual reasons for these sorts of problems are:
- running a different copy/version of the script than you think you are
(multiple installs? '.' in path? check 'which' and PATH)
- inability to find libraries (not in PYTHONPATH)
There's really very little else that can go wrong. You just have to make
sure you've double-checked all your assumptions.
Setting the version works like this:
make runs setup.py
setup.py calls mercurial/version.py to find version
version.py runs 'hg identify' and parses it
version.py creates __version__.py
setup.py copies __version__.py to the library directory
installed hg reads __version__.py
Seems you're getting fouled up in step 3.
(Newer hg takes version.py out of the equation)
--
http://selenic.com : development and support for Mercurial and Linux
More information about the Mercurial-devel
mailing list