在 Debian Squeeze 上安装 Mercurial:hg 给出“无法找到 Mercurial 库”的信息错误
在 Debian Squeeze 上看似成功安装后(通过 apt-get install Mercurial ),hg 拒绝启动,并给出此错误:
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)
我可以让它工作的唯一方法是通过 pip 安装 Mercurial install,但我认为这不是正确的方法。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在 Debian bug 跟踪器中发现了这个 bug:它描述了完全相同的问题。以下步骤解决了该问题:
因此,您可以尝试以下操作:
问题显然是 python 支持触发器未正确运行,但该错误没有给出任何原因。希望下面的命令也能为您解决问题。
更新
正如多条评论中所述,运行
dpkg-reconfigure
似乎就足够了:I found this bug in the Debian bug tracker: which describes exactly the same issue. The following steps resolved the problem :
So you can try the following:
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:确保你的Python版本相同...
或者在
/usr/bin/python
中创建适当版本的链接,问题将得到解决。root:~# which python
/usr/bin/python
root:~# ll /usr/bin/python
lrwxrwxrwx 1 root root 2015 年 12 月 9 日 /usr/bin/python -> python2.7*
root:~#
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:~#
我有同样的错误消息,但 krtek 答案中的解决方案对我不起作用。我的问题是我安装了多个版本的 python。通过 sudo update-alternatives --config python 选择正确的 python 版本解决了我的问题。
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.