MaartenGr / MaartenGr/BERTopic

Package installation problem

Open
#2,318 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
7.8k
Forks
920
Avg merge
22h 24m
Merged PRs (30d)
5

Description

### Have you searched existing issues? 🔎

- [x] I have searched and found no existing issues

### Desribe the bug

I successfully trained a model using BERTopic. I want to try calculating coherence, but I keep running into some issues.

!pip install bertopic[flair,gensim,spacy,use]
I also tried running!pip install bertopic and pip install gensim, but the same error still occurred.

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[](https://localhost:8080/#) in ()
1 from bertopic import BERTopic
----> 2 import gensim.corpora as corpora
3 from gensim.models.coherencemodel import CoherenceModel
4
5

5 frames
/usr/local/lib/python3.11/dist-packages/gensim/_matutils.pyx in init gensim._matutils()

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

### Reproduction

```python
from bertopic import BERTopic
import gensim.corpora as corpora
from gensim.models.coherencemodel import CoherenceModel
```

### BERTopic Version

0.17.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Python 3.11 reproduction: install BERTopic 0.17.0 and run the imports for BERTopic, gensim.corpora, and CoherenceModel. Inspect the package installation and the reported gensim._matutils ValueError; done means the documented installation and reproduction no longer produce the binary-incompatibility error.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
machine-learning, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.