【问题标题】:importing lmfit succesfull but importing Model from lmfit not导入 lmfit 成功但从 lmfit 导入模型不
【发布时间】:2014-12-04 10:45:08
【问题描述】:

我已经通过 PIP 安装了 lmfit

pip install lmfit==0.7.2

在 ipython notebook 中导入 lmfit 似乎可行。 也就是说,导入不会给出任何错误消息,我可以从 lmfit 调用一堆函数。

但是,当我尝试从 lmfit 导入模型时,它给了我一个导入错误:

from lmfit import Model 

导入错误。

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-151-3ba1b6658da4> in <module>()
----> 1 from lmfit import Model

ImportError: cannot import name Model

我认为这与安装失败有关,但不知道如何进一步诊断和/或如何修复它。有人有建议吗?

【问题讨论】:

  • 如果您运行 from lmfit import * 会怎样——这是否可以获得您想要的功能?

标签: python import lmfit


【解决方案1】:

我很确定模型类是 lmfit-py 0.8.1 版的新功能,因此您可能需要更新 lmfit。

(我有 0.7.2 的离线文档,其中不包含有关模型类的部分,但版本 0.8.1 的文档有)

【讨论】:

    猜你喜欢
    • 2015-03-27
    • 2020-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-11
    • 2014-12-17
    • 1970-01-01
    • 2017-12-06
    相关资源
    最近更新 更多