How to remove the error "SystemError: initialization of _internal failed without raising an exception"
Asked Answered
B

5

52

I am trying to import Top2Vec package for nlp topic modelling. But even after upgrading pip, numpy this error is coming.

I tried

pip install --upgrade pip
pip install --upgrade numpy

I was expecting to run

from top2vec import Top2Vec

model = Top2Vec(FAQs, speed='learn', workers=8)

but it is giving the mentioned error

Breunig answered 29/12, 2022 at 6:37 Comment(1)
A similar issue exists in python-numba.Caseose
D
66

It's probably related to the latest numpy release (v1.24.0). Try installing version 1.23.5:

pip install numpy==1.23.5
Donalddonaldson answered 2/1, 2023 at 11:58 Comment(1)
I have the same issue but probably for a different reason. Here is the link to my question if you can help: #75191344Hilmahilt
S
24

For me, numba caused the error, which was shown inside the error message. Updating numba solved the problem:

pip install -U numba
Sherasherar answered 3/5, 2023 at 12:11 Comment(3)
I was source building a package and faced this error, checking conda list didnt list numba but importing numba gave that error, just a 'pip install numba' sorted it for me. I am still wondering why it didn't throw the ModuleNotFound error...Arbitrator
In my case this worked in AzureML environment.Lifeless
Thanks. I couldn't from timezonefinder import TimezoneFinder. It now works thanks to your answer.Quodlibet
C
16

For me it was not the numpy release as I was already on the version 1.23.5. I simply restarted the kernel and re-imported top2vec and it worked.

P.S. I was on an AWS Linux machine

Currin answered 23/1, 2023 at 2:0 Comment(1)
worked for me! Python 3.9, Mac M1 proBarcarole
D
0

In my case, as for @CGFoX, I needed to uninstall and reinstall numba. The catch was that numba had been introduced by installing umap but then changed when I later imported scikit-image. After the latter import I had to reinstall numba-0.56.4 to avoid the error.

Dorcia answered 5/5, 2023 at 15:34 Comment(0)
P
0

I had a similar error that required updating numba. The root issue was that my Python environment was pinned to Python 3.9. Updating the whole environment to Python 3.10 resolved the issue.

Protuberate answered 9/8, 2023 at 16:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.