英文:
TypeError issue importing hdbscan
问题
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 17:59:51) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import hdbscan
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\natha\anaconda3\envs\bertopic\Lib\site-packages\hdbscan\__init__.py", line 1, in <module>
from .hdbscan_ import HDBSCAN, hdbscan
File "C:\Users\natha\anaconda3\envs\bertopic\Lib\site-packages\hdbscan\hdbscan_.py", line 40, in <module>
FAST_METRICS = KDTree.valid_metrics + BallTree.valid_metrics + ["cosine", "arccos"]
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'builtin_function_or_method' and 'builtin_function_or_method'
>>>
英文:
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 17:59:51) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import hdbscan
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\natha\anaconda3\envs\bertopic\Lib\site-packages\hdbscan\__init__.py", line 1, in <module>
from .hdbscan_ import HDBSCAN, hdbscan
File "C:\Users\natha\anaconda3\envs\bertopic\Lib\site-packages\hdbscan\hdbscan_.py", line 40, in <module>
FAST_METRICS = KDTree.valid_metrics + BallTree.valid_metrics + ["cosine", "arccos"]
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'builtin_function_or_method' and 'builtin_function_or_method'
>>>
Does anyone know how to fix this?
i tried reinstalling conda and python.
答案1
得分: 2
这是关于scikit-learn的新版本的问题,我安装了以前的版本,现在它正常工作了。有关该问题的更多信息可以在hdbscan
存储库中找到:github.com/scikit-learn-contrib/hdbscan/issues/597
英文:
It was an issue with the new version of scikit-learn, I installed a previous version and now it works. More information about the issue can be find in the hdbscan
repo: github.com/scikit-learn-contrib/hdbscan/issues/597
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论