0

After installing python top2vec package in H2O notebooks (!pip install top2vec), I am getting the following error when importing top2vec:

import top2vec

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

I tried the techniques used in https://github.com/MaartenGr/BERTopic/issues/392 and also Unable to install top2vec, but none of them were helpful. It looks it is incompatible with numpy package. Any help on how to tackle the error in H2O environment much appreciated!

enter image description here

Sam S.
  • 627
  • 1
  • 7
  • 23

1 Answers1

1

My guess would be that gensim is compiled against different version of numpy. I would try to recompile gensim (something like pip install --force-reinstall --ignore-installed --no-binary :all: gensim) or change the numpy version to the one that was there before the top2vec was installed.

Tomáš Frýda
  • 546
  • 3
  • 8
  • Thanks Tomas, as you mentioned, the problem might be with gensim and numpy versions and comaptibility. I tried pip install --force- ... but not worked for me. – Sam S. May 17 '23 at 00:52