问题
I have installed lmfit trough PIP
pip install lmfit==0.7.2
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.
However when i try to import Model from lmfit it gives me an import error:
from lmfit import Model
The import error.
---------------------------------------------------------------------------
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?
回答1:
I'm pretty sure the Model Class is new to lmfit-py release 0.8.1 so you may have to update lmfit.
(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)
来源:https://stackoverflow.com/questions/27291982/importing-lmfit-succesfull-but-importing-model-from-lmfit-not