Getting "*** failed to import extension" errors after upgrading to 1.5.1

1 view
Skip to first unread message

Pavel Shevaev

unread,
Apr 29, 2010, 5:37:54 AM4/29/10
to Mercurial Users
Folks, I have upgraded my mercurial installation to 1.5.1 version and
now hg can't find extensions.

I used to have mercurial installed by apt-get, first I removed it by
running "apt-get --purge remove mercurial" and then installed
mercurial from the source manually.

Looks like it can't find the directory with built-in extensions for
some reason. it's strange because it's definitely in PYTHONPATH: I
added "print sys.path" into /usr/local/bin/hg and now when running hg
it shows something like this:

['/usr/local/bin', ... '/usr/local/lib/python2.6/dist-packages']

... and /usr/local/lib/python2.6/dist-packages/hgext does contain the
required extension(fetch in my case)

What am I doing wrong?

-- Best regards, Pavel
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial

--
You received this message because you are subscribed to the Google Groups "mercurial" group.
To post to this group, send email to mercuria...@googlegroups.com.
To unsubscribe from this group, send email to mercurial_gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mercurial_general?hl=en.

Benoit Boissinot

unread,
Apr 29, 2010, 1:25:58 PM4/29/10
to Pavel Shevaev, Mercurial Users
On Thu, Apr 29, 2010 at 11:37 AM, Pavel Shevaev <pacha....@gmail.com> wrote:

> Looks like it can't find the directory with built-in extensions for
> some reason. it's strange because it's definitely in PYTHONPATH: I
> added "print sys.path" into /usr/local/bin/hg and now when running hg
> it shows something like this:
>
> ['/usr/local/bin', ... '/usr/local/lib/python2.6/dist-packages']
>
> ... and /usr/local/lib/python2.6/dist-packages/hgext does contain the
> required extension(fetch in my case)
>
> What am I doing wrong?

did you try to import hgext.purge from a python prompt?

Benoit

Pavel Shevaev

unread,
Apr 29, 2010, 1:55:10 PM4/29/10
to Benoit Boissinot, Mercurial Users
> did you try to import hgext.purge from a python prompt?

Hm...it gives the following:

Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hgext.purge
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named purge

At the same time:

>>> import sys
>>> print sys.path
['', ... '/usr/local/lib/python2.6/dist-packages']

and:

>>> import hgext

...works just fine and there is
/usr/local/lib/python2.6/dist-packages/hgext/purge.py

I'm a bit lost :(

--
Best regards, Pavel

Vishakh Harikumar

unread,
Apr 29, 2010, 1:59:27 PM4/29/10
to Pavel Shevaev, Mercurial Users


On Thu, Apr 29, 2010 at 3:07 PM, Pavel Shevaev <pacha....@gmail.com> wrote:
Folks, I have upgraded my mercurial installation to 1.5.1 version and
now hg can't find extensions.

I used to have mercurial installed by apt-get, first I removed it by
running "apt-get --purge remove mercurial" and then installed
mercurial from the source manually.

Looks like it can't find the directory with built-in extensions for
some reason. it's strange because it's definitely in PYTHONPATH: I
added "print sys.path" into /usr/local/bin/hg and now when running hg
it shows something like this:

['/usr/local/bin', ... '/usr/local/lib/python2.6/dist-packages']

... and /usr/local/lib/python2.6/dist-packages/hgext does contain the
required extension(fetch in my case)

What am I doing wrong?

-- Best regards, Pavel
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial

did apt-get remove the 'mercurial-common' package as well?

--
vsh

Benoit Boissinot

unread,
Apr 29, 2010, 2:03:13 PM4/29/10
to Pavel Shevaev, Mercurial Users
On Thu, Apr 29, 2010 at 09:55:10PM +0400, Pavel Shevaev wrote:
> > did you try to import hgext.purge from a python prompt?
>
> Hm...it gives the following:
>
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import hgext.purge
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named purge
>
> At the same time:
>
> >>> import sys
> >>> print sys.path
> ['', ... '/usr/local/lib/python2.6/dist-packages']
>
> and:
>
> >>> import hgext
>
> ...works just fine and there is
> /usr/local/lib/python2.6/dist-packages/hgext/purge.py

it's probably not the same hgext that is found

Benoit

--
:wq

Vishakh Harikumar

unread,
Apr 29, 2010, 2:20:29 PM4/29/10
to Pavel Shevaev, Mercurial Users
seems like apt-get doesnt remove the mercurial-common package along with mercurial
do a 'apt-get remove mercurial-common' as well

--
vsh

Pavel Shevaev

unread,
Apr 29, 2010, 2:24:06 PM4/29/10
to Vishakh Harikumar, Mercurial Users
> seems like apt-get doesnt remove the mercurial-common package along with
> mercurial
> do a 'apt-get remove mercurial-common' as well

Didn't help :(


--
Best regards, Pavel
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Pavel Shevaev

unread,
May 2, 2010, 2:18:46 PM5/2/10
to Vishakh Harikumar, Mercurial Users
Since I have no idea what is wrong with my setup I'm just using full
paths in ~/.hgrc to built-in extensions :)

Martin Geisler

unread,
May 3, 2010, 7:16:50 AM5/3/10
to Pavel Shevaev, Vishakh Harikumar, Mercurial Users
Pavel Shevaev <pacha....@gmail.com> writes:

> Since I have no idea what is wrong with my setup I'm just using full
> paths in ~/.hgrc to built-in extensions :)

Some extensions have been turned into core commands -- the hbisect
extension is an example of this. The import errors can then occur if you
still have an old configuration file that references the no longer
existing extension. On Debian/Ubuntu, you run into this if you uninstall
Mercurial instead of purging it.

Please use

hg showconfig --debug

to see all the configuration values Mercurial pick up and especially
where they are loaded from. Then disable the extensions by editing the
corresponding files or by adding entries to your ~/.hgrc of the form:

extension = !

See:

http://www.selenic.com/mercurial/hgrc.5.html#extensions

--
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/
Reply all
Reply to author
Forward
0 new messages