arundo / adtk

A Python toolkit for rule-based/unsupervised anomaly detection in time series
https://adtk.readthedocs.io
Mozilla Public License 2.0
1.06k stars 143 forks source link

LevelShiftAD #129

Closed estcarisimo closed 3 years ago

estcarisimo commented 3 years ago

Hey folks,

I am trying to import LevelShiftAD but it seems there are some import problems within this module. This is what I get when I try to import it

     10 from scipy import linalg, fft as sp_fft
     11 from scipy.fft._helper import _init_nd_shape_and_axes
---> 12 from scipy._lib._util import prod as _prod
     13 import numpy as np
     14 from scipy.special import lambertw

ImportError: cannot import name 'prod'

I am running Python 3.6.9 on a virtual environment. Any clue of how I could fix it? I've already tried it by downgrading scipy to 1.2 and 1.3.

Thanks!

earthgecko commented 3 years ago

Hi @estcarisimo

From one user to another.

This does not appear to be an issue with adtk because that import is not part of the current adtk.

There are is only one scipy import in the current v0.6.2, master and development branches, I have not checked older releases. If your are running on an older release just try updating.

You can confirm that you can load adtk by running the following single import in your virtualenv:

from adtk.detector import LevelShiftAD

You can verify your environment as far as scipy is concerned as well:

from scipy._lib._util import prod as _prod

If you run both of those individually in a new Python instance in your virtualenv I think you may find that adtk works and scipy does not.

The import snippet you pasted is probably from site-packages/scipy/signal/signaltools.py or similar.

I hope this helps.

estcarisimo commented 3 years ago

Hi @earthgecko ,

Thanks for your quick reply.

I upgraded scipy and other packets depending on it and ADTK finally worked.