Skip to content

BUG: ImportError: cannot import name 'NaN' from 'numpy' in squeeze_pro.py #61438

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

Closed
3 tasks done
heidongqilin opened this issue May 14, 2025 · 1 comment
Closed
3 tasks done
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@heidongqilin
Copy link

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas_ta as ta

Issue Description

D:\t70\duanxian>python duanxian_TDI_TSI_DIV.py

Traceback (most recent call last):

  File "D:\t70\duanxian\duanxian_TDI_TSI_DIV.py", line 11, in

    import pandas_ta as ta # 新增:用于 ALMA 等指标

    ^^^^^^^^^^^^^^^^^^^^^^

  File "D:\veighna_studio\Lib\site-packages\pandas_ta_init_.py", line 116, in

    from pandas_ta.core import *

  File "D:\veighna_studio\Lib\site-packages\pandas_ta\core.py", line 18, in

    from pandas_ta.momentum import *

  File "D:\veighna_studio\Lib\site-packages\pandas_ta\momentum_init_.py", line 34, in

    from .squeeze_pro import squeeze_pro

  File "D:\veighna_studio\Lib\site-packages\pandas_ta\momentum\squeeze_pro.py", line 2, in

    from numpy import NaN as npNaN

ImportError: cannot import name 'NaN' from 'numpy' (D:\veighna_studio\Lib\site-packages\numpy_init_.py). Did you mean: 'nan'?

Expected Behavior

import pandas_ta success

Installed Versions

Operating System: [Your OS, e.g., Windows 10/11]
Python Version: [Your Python version, e.g., 3.9, 3.10, 3.11 - based on your traceback, it seems like Python 3.13 based on "cp313" in numpy download, please confirm]
pandas_ta Version: 0.3.14b0 (Confirmed via pip show pandas_ta)
numpy Version: 2.2.5 (Confirmed via pip show numpy)
pandas Version: 2.2.3 (Confirmed via pip show pandas)

@heidongqilin heidongqilin added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels May 14, 2025
@mroeschke
Copy link
Member

Thanks for the report. pandas_ta is not maintained by this repository so I would suggest pinging the owners of that repository. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants