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

导入报错问题 #113

Open
wu1214 opened this issue Jan 3, 2023 · 4 comments
Open

导入报错问题 #113

wu1214 opened this issue Jan 3, 2023 · 4 comments

Comments

@wu1214
Copy link

wu1214 commented Jan 3, 2023

你好,我下载的toad版本是0.1.1,numpy版本是'1.24.1',但是import toad时会报错:AttributeError: module 'numpy' has no attribute 'float',想请问下是版本不符合吗?我看要求是大于1.20就行,感谢回复!

@Secbone
Copy link
Member

Secbone commented Jan 3, 2023

@wu1214 尝试也更新一下 cython 的版本试一下?

@hongfeijiang
Copy link

你好,我更新了numpy、cython的版本到最新,执行c.fit(train_select, y = 'label', method = 'chi', min_samples = 0.05,exclude = None)时也会报错:AttributeError: module 'numpy' has no attribute 'float',想问下是什么原因,有什么办法解决么,感谢回复

@joelun37
Copy link

Hi,

I don't know why it works but I have a working solution:

  • create a new environment
  • install the IPython package
  • launch IPython within that that environment
  • install toad with the following line of code:

#Install a conda package in the current Jupyter kernel
import sys
!conda install -c conda-forge --yes --prefix {sys.prefix} toad

I found the conda installation line of code here.

Note: I also tried changing all "np.float"s in the source code into "float"s but that didn't work.

@Secbone
Copy link
Member

Secbone commented Mar 26, 2023

@joelun37 @wu1214 @hongfeijiang numpy1.24.0 的版本开始删除了一些方法导致这个问题,所以可以尝试将 numpy 的版本降到 1.23.5 及以下。
针对 numpy 新版本的兼容问题,目前已在源码完成兼容,会在下个版本时一起发布

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants