CamDavidsonPilon / lifelines

Survival analysis in Python
lifelines.readthedocs.org
MIT License
2.32k stars 551 forks source link

ImportError: cannot import name 'trapz' from 'scipy.integrate' with scipy pre-release #1618

Closed Zethson closed 5 days ago

Zethson commented 2 weeks ago

from lifelines import ( /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/lifelines/init.py:4: in from lifelines.fitters.weibull_fitter import WeibullFitter /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/lifelines/fitters/init.py:21: in from scipy.integrate import trapz E ImportError: cannot import name 'trapz' from 'scipy.integrate' (/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/scipy/integrate/init.py)

with the scipy pre-release version

scipy.integrate.trapz, scipy.integrate.cumtrapz, and scipy.integrate.simps have been deprecated in favour of scipy.integrate.trapezoid, scipy.integrate.cumulative_trapezoid, and scipy.integrate.simpson respectively and will be removed in SciPy 1.14.

mariosyndena commented 6 days ago

encountered the same issue: works with scipy 1.13.1, but not with scipy 1.14. plz update dependencies or add support for 1.14.