MaartenGr / MaartenGr/BERTopic

SystemError: initialization of _internal failed without raising an exception

Open
#1,715 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The following error occurs simply importing bertopic.
```
from bertopic import BERTopic

---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
/tmp/ipykernel_105749/22541067.py in
7 tqdm.pandas(desc="Processing Rows")
8
----> 9 from bertopic import BERTopic
10 from umap import UMAP

~/.local/lib/python3.10/site-packages/bertopic/__init__.py in
----> 1 from bertopic._bertopic import BERTopic
2
3 __version__ = "0.13.0"
4
5 __all__ = [

~/.local/lib/python3.10/site-packages/bertopic/_bertopic.py in
24 # Models
25 import hdbscan
---> 26 from umap import UMAP
27 from sklearn.preprocessing import normalize
28 from sklearn import __version__ as sklearn_version

~/.local/lib/python3.10/site-packages/umap/__init__.py in
1 from warnings import warn, catch_warnings, simplefilter
----> 2 from .umap_ import UMAP
3
4 try:
5 with catch_warnings():

~/.local/lib/python3.10/site-packages/umap/umap_.py in
26 from scipy.sparse import tril as sparse_tril, triu as sparse_triu
27 import scipy.sparse.csgraph
---> 28 import numba
29
30 import umap.distances as dist

~/.local/lib/python3.10/site-packages/numba/__init__.py in
40
41 # Re-export vectorize decorators and the thread layer querying function
---> 42 from numba.np.ufunc import (vectorize, guvectorize, threading_layer,
43 get_num_threads, set_num_threads,
44 set_parallel_chunksize, get_parallel_chunksize,

~/.local/lib/python3.10/site-packages/numba/np/ufunc/__init__.py in
1 # -*- coding: utf-8 -*-
2
----> 3 from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize
4 from numba.np.ufunc._internal import PyUFunc_None, PyUFunc_Zero, PyUFunc_One
5 from numba.np.ufunc import _internal, array_exprs

~/.local/lib/python3.10/site-packages/numba/np/ufunc/decorators.py in
1 import inspect
2
----> 3 from numba.np.ufunc import _internal
4 from numba.np.ufunc.parallel import ParallelUFuncBuilder, ParallelGUFuncBuilder
5

SystemError: initialization of _internal failed without raising an exceptio
```

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 import path in bertopic/_bertopic.py and the failing numba.np.ufunc._internal import shown in the traceback. Reproduce `from bertopic import BERTopic` in the reported Python 3.10 environment, then inspect the project's dependency and version constraints. Done means the import succeeds with a confirmed compatible dependency combination.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.