TypeError导入hdbscan时出现问题。

huangapple go评论143阅读模式
英文:

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 &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import hdbscan
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Users\natha\anaconda3\envs\bertopic\Lib\site-packages\hdbscan\__init__.py&quot;, line 1, in &lt;module&gt;
    from .hdbscan_ import HDBSCAN, hdbscan
  File &quot;C:\Users\natha\anaconda3\envs\bertopic\Lib\site-packages\hdbscan\hdbscan_.py&quot;, line 40, in &lt;module&gt;
    FAST_METRICS = KDTree.valid_metrics + BallTree.valid_metrics + [&quot;cosine&quot;, &quot;arccos&quot;]
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: &#39;builtin_function_or_method&#39; and &#39;builtin_function_or_method&#39;
&gt;&gt;&gt;

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

huangapple
  • 本文由 发表于 2023年7月3日 09:01:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76601326.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定