Installing Mercurial on Debian Squeeze: hg gives an "couldn't find mercurial libraries" error

14,400

Solution 1

I found this bug in the Debian bug tracker: which describes exactly the same issue. The following steps resolved the problem :

debsums -c python-support showed no differences, but reinstalling python-support before reinstalling mercurial and mercurial-common actually solved the issue.

So you can try the following:

apt-get --reinstall install python-support
apt-get --reinstall install mercurial mercurial-common

The problem is apparently that python-support triggers aren't run correctly, but the bug doesn't give any reason as of why. Hopefully the comands below will also solve the issue for you.

Update

As said in multiple comments, running dpkg-reconfigure seems to be sufficient:

dpkg-reconfigure python-support

Solution 2

Make sure your python version is same... Or create a link in /usr/bin/python at proper version, problem will be resolved.

root:~# which python

/usr/bin/python

root:~# ll /usr/bin/python

lrwxrwxrwx 1 root root 9 Dec 9 2015 /usr/bin/python -> python2.7*

root:~#

Share:
14,400
side2k
Author by

side2k

Updated on June 03, 2022

Comments

  • side2k
    side2k about 2 years

    After seemingly-successful installation on Debian Squeeze(via apt-get install mercurial), hg refuses to start, giving this error:

    root@pe-test:/tmp/example.com# hg
    abort: couldn't find mercurial libraries in [/usr/bin /usr/lib/python2.6 /usr/lib/python2.6/plat-linux2 /usr/lib/python2.6/lib-tk /usr/lib/python2.6/lib-old /usr/lib/python2.6/lib-dynload /usr/local/lib/python2.6/dist-packages /usr/lib/python2.6/dist-packages /usr/lib/pymodules/python2.6]
    (check your install and PYTHONPATH)
    

    The only way I can get it working is to install mercurial via pip install, but I don't think its a proper way.

  • side2k
    side2k over 12 years
    Thanks. You've helped me. This solved the issue: dpkg-reconfigure python-support
  • schmijos
    schmijos over 11 years
    Actually just dpkg-reconfigure python-support did resolve it for me.