在 Debian Squeeze 上安装 Mercurial:hg 给出“无法找到 Mercurial 库”的信息错误

发布于 2024-12-16 17:20:45 字数 528 浏览 0 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦在夏天 2024-12-23 17:20:45

我在 Debian bug 跟踪器中发现了这个 bug:它描述了完全相同的问题。以下步骤解决了该问题:

debsums -c python-support 显示没有差异,但是重新安装
重新安装 Mercurial 和 Mercurial-common 之前的 python-support
实际上解决了问题

因此,您可以尝试以下操作:

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

问题显然是 python 支持触发器未正确运行,但该错误没有给出任何原因。希望下面的命令也能为您解决问题。

更新

正如多条评论中所述,运行 dpkg-reconfigure 似乎就足够了:

dpkg-reconfigure python-support

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
吹梦到西洲 2024-12-23 17:20:45

确保你的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:~#

ま昔日黯然 2024-12-23 17:20:45

我有同样的错误消息,但 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文