jbn / ZigZag

Python library for identifying the peaks and valleys of a time series.
BSD 3-Clause "New" or "Revised" License
434 stars 174 forks source link

ModuleNotFoundError: No module named 'zigzag.core' #9

Closed john-intele closed 2 years ago

john-intele commented 4 years ago

When run the example

from pandas_datareader import get_data_yahoo
from zigzag import *

X = get_data_yahoo('GOOG')['Adj Close']
pivots = peak_valley_pivots(X.values, 0.2, -0.2)
ts_pivots = pd.Series(X, index=X.index)
ts_pivots = ts_pivots[pivots != 0]
X.plot()
ts_pivots.plot(style='g-o');

I got this error, I did run pip install zigzag

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-98-e7b98d0b102d> in <module>
      1 from pandas_datareader import get_data_yahoo
----> 2 from zigzag import *
      3 
      4 X = get_data_yahoo('GOOG')['Adj Close']
      5 pivots = peak_valley_pivots(X.values, 0.2, -0.2)

~/opt/miniconda3/lib/python3.8/site-packages/zigzag/__init__.py in <module>
----> 1 from zigzag.core import *
      2 
      3 
      4 __title__ = "zigzag"
      5 __description__ = "Package for finding peaks and valleys of time series."

ModuleNotFoundError: No module named 'zigzag.core'
pbrumblay commented 3 years ago

@john-intele - a little late in finding this problem but I was able to reproduce it for a while. I no longer can reproduce this after:

$ pip uninstall -y ZigZag
$ python -m pip install --no-cache-dir --force-reinstall  ZigZag

I'm not sure how we hosed our systems or how the clean install fixed it, but maybe this comment helps someone out in the future.

Note: I also ran pip install cython during my troubleshooting. Not sure if that's related.

ChenLi0830 commented 2 years ago

For me, the problem was that I tried to run the ipynb file from a cloned ZigZag repo. And when executing from zigzag import *, it tried to import zigzag from the local repo instead from the pip installed package.

Solution:

jbn commented 2 years ago

Both problems were more on ZigZags end. The new version (0.3.0) should fix the install problems.

ZiggyReQurv commented 1 year ago

I have the same problem, I download the zip file and then install the package. I solve the problem deleting from my local files the zigzag folder that contain the package