导入 Mercurial api 时出错

发布于 2024-10-04 10:03:25 字数 986 浏览 2 评论 0原文

有下一个问题:

有一个 django 项目,我需要在其中使用 Mercurial api。 当我执行下一步时:

from mercurial import hg,ui

我收到错误:

Exception Type: ImportError
Exception Value: cannot import name hg
Exception Location: //some.py in , line 1
Python Executable:  /usr/bin/python2.6
Python Version: 2.6.6
Python Path:    ['/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/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0']

放置 Mercurial 包的 PythonPath 中有 '/usr/lib/pymodules/python2.6' 。 当我将 /usr/lib/pymodules/python2.6/mercurial 添加到 PythonPath 中时,evev 并没有解决问题。

您有什么建议吗? 谢谢

Have the next problem:

There is a django project and I need use the mercurial api in it.
When I do the next:

from mercurial import hg,ui

I get error:

Exception Type: ImportError
Exception Value: cannot import name hg
Exception Location: //some.py in , line 1
Python Executable:  /usr/bin/python2.6
Python Version: 2.6.6
Python Path:    ['/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/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0']

there is '/usr/lib/pymodules/python2.6' in the PythonPath where mercurial package is placed.
evev when I added /usr/lib/pymodules/python2.6/mercurial into the PythonPath does not solve the problem.

Do you have any suggestion?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文