Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy ImportError: cannot import name 'sliding_window_view' from 'numpy.lib.stride_tricks' #324

Closed
lakhanisagara opened this issue Jul 3, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists info Informational

Comments

@lakhanisagara
Copy link

lakhanisagara commented Jul 3, 2021

Doing following -

!pip install -U git+https://github.com/twopirllc/pandas-ta
import pandas_ta 

Gives following error -

Collecting git+https://github.com/twopirllc/pandas-ta
...
...
Successfully installed pandas-ta-0.3.2b0
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-74be42ea8840> in <module>
      1 #!pip install pandas_ta
      2 get_ipython().system('pip install -U git+https://github.com/twopirllc/pandas-ta' class="ansi-blue-fg">)
----> 3 import pandas_ta

/opt/conda/lib/python3.7/site-packages/pandas_ta/__init__.py in <module>
    114 }
    115 
--> 116 from pandas_ta.core import *

/opt/conda/lib/python3.7/site-packages/pandas_ta/core.py in <module>
     12 
     13 from pandas_ta import Category, Imports, version
---> 14 from pandas_ta.candles.cdl_pattern import ALL_PATTERNS
     15 from pandas_ta.candles import *
     16 from pandas_ta.cycles import *

/opt/conda/lib/python3.7/site-packages/pandas_ta/candles/__init__.py in <module>
      1 # -*- coding: utf-8 -*-
----> 2 from .cdl_doji import cdl_doji
      3 from .cdl_inside import cdl_inside
      4 from .cdl_pattern import cdl_pattern, cdl, ALL_PATTERNS as CDL_PATTERN_NAMES
      5 from .cdl_z import cdl_z

/opt/conda/lib/python3.7/site-packages/pandas_ta/candles/cdl_doji.py in <module>
      1 # -*- coding: utf-8 -*-
----> 2 from pandas_ta.overlap import sma
      3 from pandas_ta.utils import get_offset, high_low_range, is_percent
      4 from pandas_ta.utils import real_body, verify_series
      5 

/opt/conda/lib/python3.7/site-packages/pandas_ta/overlap/__init__.py in <module>
      4 from .ema import ema
      5 from .fwma import fwma
----> 6 from .hilo import hilo
      7 from .hl2 import hl2
      8 from .hlc3 import hlc3

/opt/conda/lib/python3.7/site-packages/pandas_ta/overlap/hilo.py in <module>
      2 from numpy import nan as npNaN
      3 from pandas import DataFrame, Series
----> 4 from .ma import ma
      5 from pandas_ta.utils import get_offset, verify_series
      6 

/opt/conda/lib/python3.7/site-packages/pandas_ta/overlap/ma.py in <module>
      6 from .fwma import fwma
      7 from .hma import hma
----> 8 from .linreg import linreg
      9 from .midpoint import midpoint
     10 from .pwma import pwma

/opt/conda/lib/python3.7/site-packages/pandas_ta/overlap/linreg.py in <module>
      4 from numpy import nan as npNaN
      5 from numpy import pi as npPi
----> 6 from numpy.lib.stride_tricks import sliding_window_view
      7 from pandas import Series
      8 from pandas_ta.utils import get_offset, verify_series

ImportError: cannot import name 'sliding_window_view' from 'numpy.lib.stride_tricks' (/opt/conda/lib/python3.7/site-packages/numpy/lib/stride_tricks.py)

I tried install older version which use to work for me using following command but I assume it couldn't find any earlier version.

pip install 'pandas_ta<0.3.02b0' --force-reinstall

ERROR: Could not find a version that satisfies the requirement pandas_ta<0.3.02b0
ERROR: No matching distribution found for pandas_ta<0.3.02b0

Is it a bug in newer 0.3.02b version?
Am I using correct command to install older version?

@lakhanisagara lakhanisagara added the bug Something isn't working label Jul 3, 2021
@twopirllc twopirllc changed the title ImportError with version pandas-ta-0.3.2b0 Numpy ImportError: cannot import name 'sliding_window_view' from 'numpy.lib.stride_tricks' Jul 3, 2021
@twopirllc
Copy link
Owner

Hello @lakhanisagara,

Please see Issue #285.

Kind Regards,
KJ

@twopirllc twopirllc removed their assignment Jul 3, 2021
@twopirllc twopirllc added duplicate This issue or pull request already exists info Informational and removed bug Something isn't working labels Jul 3, 2021
@twopirllc
Copy link
Owner

Hello @lakhanisagara,

I assume by no response that the solution provided was sufficient. Thus I will be closing this issue in a few days.

Kind Regards,
KJ

@gate27keeper

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists info Informational
Projects
None yet
Development

No branches or pull requests

3 participants