lmfit package ImportError: cannot import name differential_evolution

邮差的信 提交于 2020-01-06 05:42:06

问题


As the title I'm duelling just with the import of the package lmfit which does not want to load. I just called the interpreter and then typed

import lmfit

but the import does not seem to go in the right direction, and I get this message of error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/lmfit/__init__.py", line 42, in <module>
    from .confidence import conf_interval, conf_interval2d
  File "/Library/Python/2.7/site-packages/lmfit/confidence.py", line 12, in <module>
    from .minimizer import MinimizerException
  File "/Library/Python/2.7/site-packages/lmfit/minimizer.py", line 26, in <module>
    from scipy.optimize import differential_evolution, least_squares
ImportError: cannot import name differential_evolution

I took a look here on SO, but all the answers related to ImportError: did not have satisfying answers, plus I'm quite a newbie in Python, so if there's some mistake I made I'm looking forward for your explanation.


回答1:


It's trying to use scipy, which it appears you do not have. Try installing scipy. i.e. pip install scipy or conda install if using anaconda.



来源:https://stackoverflow.com/questions/49905556/lmfit-package-importerror-cannot-import-name-differential-evolution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!