12

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.

2
  • 1
    I'v installed Mercurial on plenty of Debian boxes and never had a problem. How do you installed Pyhton ? Your python looking path seems strange to me. Did the mercurial-common package was also installed ? If I were you, I'd try to reinstall python or at least check if you didn't change something to your Python install, the problem doesn't seem related directly to Mercurial
    – krtek
    Commented Nov 17, 2011 at 16:12
  • For the record, pip install mercurial worked for me (I had apt-get purge mercurial first). I suppose apt-get is supposed to just work, but it didn't, so pip is okay by me. Commented Sep 12 at 22:26

3 Answers 3

25

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
2
  • 2
    Thanks. You've helped me. This solved the issue: dpkg-reconfigure python-support
    – side2k
    Commented Nov 19, 2011 at 12:55
  • Actually just dpkg-reconfigure python-support did resolve it for me.
    – schmijos
    Commented Nov 13, 2012 at 10:20
1

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:~#

0

I had the same error message, but the solution in krtek's answer did not work for me. My problem was that I had several versions of python installed. Choosing the right python version via sudo update-alternatives --config python solved the problem for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.