【问题标题】:Python Lifetimes Module ErrorPython 生命周期模块错误
【发布时间】:2016-02-13 05:17:39
【问题描述】:

我试图在我的 Linux AMI 服务器上加载 Lifetimes 模块。 我安装得很好,一切似乎都没有错误。

但是当我去使用它时,我得到了下面的错误。 (尝试做一些我认为可以解决的事情,但没有任何效果)

import lifetimes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lifetimes/__init__.py", line 1, in <module>
    from .estimation import BetaGeoFitter, ParetoNBDFitter, GammaGammaFitter
  File "lifetimes/estimation.py", line 2, in <module>
    from collections import OrderedDict
ImportError: cannot import name OrderedDict

【问题讨论】:

  • 您是作为root 用户安装的,还是作为非特权用户安装在$HOME 目录中的?
  • 运行python -V。确保确保您在 Python 2.7 上运行。这是您在 Python 2.6 或更早版本上会收到的错误消息。
  • 你说得对,我正在运行 python 2.6。谢谢
  • 看来我同时安装了 2.7 和 2.6。我以为我在运行 2.7 但显然不是

标签: python python-2.7 lifetime-scoping


【解决方案1】:

http://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux

这对我有用,但我确实必须将 2.6 上的模块重新安装到 2.7 中

【讨论】:

    猜你喜欢
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 2017-05-03
    • 2013-11-26
    • 2017-12-27
    • 2014-09-10
    • 2014-04-18
    • 2013-09-24
    相关资源
    最近更新 更多