问题描述
我已安装lmfit槽PIP
I have installed lmfit trough PIP
pip install lmfit==0.7.2
在ipython笔记本中导入lmfit似乎有效。
也就是说,导入不会给出任何错误消息,我可以从lmfit调用一堆函数。
importing lmfit in ipython notebook seems to work.That is, the import does not give any error messages and I can call a bunch of functions from lmfit.
然而,当我尝试从lmfit导入模型时,它给我一个导入错误:
However when i try to import Model from lmfit it gives me an import error:
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
我假设这与安装失败有关,但不知道如何进一步诊断和/或如何解决它。有人有建议吗?
I assume this has to do with a failed installation but do not know how to diagnose this further and/or how to fix it. Does anyone have a suggestion?
推荐答案
我很确定Model Class是lmfit-py发布0.8.1的新手,所以你可能要更新lmfit 。
I'm pretty sure the Model Class is new to lmfit-py release 0.8.1 so you may have to update lmfit.
(我有0.7.2的离线文档,其中没有关于模型类的部分,但版本0.8.1的文档有它)
(I have the offline documentation for 0.7.2 which does not include a section on the Model Class, but the documentation for version 0.8.1 has it)
这篇关于导入lmfit成功但从lmfit导入模型没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!