Top2Vec import fails due to problems with numpy version conflicts

Viewed 162

I'm facing an issue which seems to occur very often but the solutions I found so far did not helped me. When I try to do from top2vec import Top2Vec I get the following error:

ValueError                                Traceback (most recent call last)
<ipython-input-14-f6d7059c0d66> in <module>
----> 1 from top2vec import Top2Vec
      2 model = Top2Vec(documents=data, speed="learn", workers=8)

~/env_env/lib/python3.7/site-packages/top2vec/__init__.py in <module>
----> 1 from top2vec.Top2Vec import Top2Vec
      2 
      3 __version__ = '1.0.26'

~/env_env/lib/python3.7/site-packages/top2vec/Top2Vec.py in <module>
      9 from gensim.parsing.preprocessing import strip_tags
     10 import umap
---> 11 import hdbscan
     12 from wordcloud import WordCloud
     13 import matplotlib.pyplot as plt

~/env_env/lib/python3.7/site-packages/hdbscan/__init__.py in <module>
----> 1 from .hdbscan_ import HDBSCAN, hdbscan
      2 from .robust_single_linkage_ import RobustSingleLinkage, robust_single_linkage
      3 from .validity import validity_index
      4 from .prediction import (approximate_predict,
      5                          membership_vector,

~/env_env/lib/python3.7/site-packages/hdbscan/hdbscan_.py in <module>
     19 from scipy.sparse import csgraph
     20 
---> 21 from ._hdbscan_linkage import (single_linkage,
     22                                mst_linkage_core,
     23                                mst_linkage_core_vector,

hdbscan/_hdbscan_linkage.pyx in init hdbscan._hdbscan_linkage()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

When I try to upgrade to numpy==1.20.0 like other solutions suggest than I get in trouble with other packages I need (as displayed in the ERROR warnings below)

ERROR: transformers 4.9.1 has requirement huggingface-hub==0.0.12, but you'll have huggingface-hub 0.0.15 which is incompatible.
ERROR: flair 0.8.0.post1 has requirement numpy<1.20.0, but you'll have numpy 1.20.0 which is incompatible.de here

Does anyone has an idea how to work around on this or was facing the similar issue? I would appreciate every kind of hint!!! Thanks in advance!

0 Answers
Related