amphibian-dev / toad

ESC Team's credit scorecard tools.
https://toad.readthedocs.io
MIT License
474 stars 173 forks source link

导入报错问题 #113

Open wu1214 opened 1 year ago

wu1214 commented 1 year ago

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

Secbone commented 1 year ago

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

hongfeijiang commented 1 year ago

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

joelun37 commented 1 year ago

Hi,

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

#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 commented 1 year ago

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