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

hsgswve4  于 4个月前  发布在  其他
关注(0)|答案(3)|浏览(48)

我正在尝试导入BERTopic,但是遇到了这个错误: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'。你知道为什么吗?提前谢谢!

yr9zkbsy

yr9zkbsy1#

好的,所以我卸载了numba,重新安装了numba,然后重新安装了bertopic,现在它给我这个错误:
RuntimeError: Failed to import transformers.models.auto because of the following error (look up to see its traceback): libsentencepiece.so.0: cannot open shared object file: No such file or directory
你知道这是什么意思吗?如果你认为这有帮助的话,我可以提供完整的回溯信息。谢谢!

dohp0rv5

dohp0rv52#

你可以尝试从一个全新的环境中安装它吗?这可能会帮助防止任何残留安装引起的问题。

7fhtutme

7fhtutme3#

@MaartenGr 我更新了环境(我不确定具体改变了什么),现在可以正常工作了!谢谢!

相关问题