DEAP / deap

Distributed Evolutionary Algorithms in Python
http://deap.readthedocs.org/
GNU Lesser General Public License v3.0
5.75k stars 1.12k forks source link

deap\benchmarks\tools.py #656

Open johnlvjinya opened 2 years ago

johnlvjinya commented 2 years ago

File "...\lib\site-packages\deap\benchmarks\tools.py", line 315, in igd if not scipy: NameError: name 'scipy' is not defined

################################################## scipy_import = True try: from scipy.spatial import distance except ImportError: scipy_import = False

def igd(A, Z): """Inverse generational distance. """ if not scipy_import: raise ImportError("idg requires scipy module") distances = distance.cdist(A, Z) return numpy.average(numpy.min(distances, axis=0)) ####################################################

superhxl commented 2 years ago

I also find this problem. Why no any other comments?

fmder commented 2 years ago

That is weird because there is no if not scipy line in the code referenced. Maybe a configuration problem with multiple installed version of deap?