MaartenGr / MaartenGr/BERTopic

AttributeError: module 'numpy' has no attribute 'long'

Open
#1,416 3 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

I am trying to import BERTopic, but I am getting this error:

Traceback (most recent call last): File "/om2/user/kmcclenn/item_analysis/openmind_python_files/scripts/test_script.py", line 92, in <module> run() File "/om2/user/kmcclenn/item_analysis/openmind_python_files/scripts/test_script.py", line 73, in run from bertopic import BERTopic File "/net/vast-storage/scratch/vast/gablab/kmcclenn/bin/mambaforge/envs/item-analysis/lib/python3.8/site-packages/bertopic/__init__.py", line 1, in <module> from bertopic._bertopic import BERTopic File "/net/vast-storage/scratch/vast/gablab/kmcclenn/bin/mambaforge/envs/item-analysis/lib/python3.8/site-packages/bertopic/_bertopic.py", line 38, in <module> from umap import UMAP File "/net/vast-storage/scratch/vast/gablab/kmcclenn/bin/mambaforge/envs/item-analysis/lib/python3.8/site-packages/umap/__init__.py", line 2, in <module> from .umap_ import UMAP File "/net/vast-storage/scratch/vast/gablab/kmcclenn/bin/mambaforge/envs/item-analysis/lib/python3.8/site-packages/umap/umap_.py", line 28, in <module> import numba File "/net/vast-storage/scratch/vast/gablab/kmcclenn/bin/mambaforge/envs/item-analysis/lib/python3.8/site-packages/numba/__init__.py", line 16, in <module> from numba.core import types, errors File "/net/vast-storage/scratch/vast/gablab/kmcclenn/bin/mambaforge/envs/item-analysis/lib/python3.8/site-packages/numba/core/types/__init__.py", line 108, in <module> long_ = _make_signed(np.long) File "/net/vast-storage/scratch/vast/gablab/kmcclenn/bin/mambaforge/envs/item-analysis/lib/python3.8/site-packages/numpy/__init__.py", line 320, in __getattr__ raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'long'

Do you know why? Thanks in advance!

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 traceback path from BERTopic through UMAP and Numba, then compare the installed NumPy, Numba, UMAP, and BERTopic versions. Done means identifying the incompatible dependency combination and confirming that from bertopic import BERTopic completes without the numpy.long AttributeError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.