Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 328
side2k Avatar asked Nov 17 '11 16:11

side2k


2 Answers

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
like image 155
krtek Avatar answered Sep 21 '22 12:09

krtek


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

like image 28
Prakash Katudia Avatar answered Sep 20 '22 12:09

Prakash Katudia