You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A week ago everything was perfectly working, however, now, while importing gensim model Word2Vec, after successful installation of the gensim package in Google Colab, I am facing this error. ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
Steps to Reproduce Error
Install the library via !pip install gensim
Import Word2Vec via from gensim.models import Word2Vec
Complete Error Output
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-3-d83094a7b397>](https://localhost:8080/#) in <cell line: 0>()
1 # Import Libraries
----> 2 from gensim.models import Word2Vec
3 import nltk
4 nltk.download('punkt_tab')
5 from nltk.tokenize import word_tokenize
5 frames
[/usr/local/lib/python3.11/dist-packages/gensim/__init__.py](https://localhost:8080/#) in <module>
9 import logging
10
---> 11 from gensim import parsing, corpora, matutils, interfaces, models, similarities, utils # noqa:F401
12
13
[/usr/local/lib/python3.11/dist-packages/gensim/corpora/__init__.py](https://localhost:8080/#) in <module>
4
5 # bring corpus classes directly into package namespace, to save some typing
----> 6 from .indexedcorpus import IndexedCorpus # noqa:F401 must appear before the other classes
7
8 from .mmcorpus import MmCorpus # noqa:F401
[/usr/local/lib/python3.11/dist-packages/gensim/corpora/indexedcorpus.py](https://localhost:8080/#) in <module>
12 import numpy
13
---> 14 from gensim import interfaces, utils
15
16 logger = logging.getLogger(__name__)
[/usr/local/lib/python3.11/dist-packages/gensim/interfaces.py](https://localhost:8080/#) in <module>
17 import logging
18
---> 19 from gensim import utils, matutils
20
21
[/usr/local/lib/python3.11/dist-packages/gensim/matutils.py](https://localhost:8080/#) in <module>
1032 try:
1033 # try to load fast, cythonized code if possible
-> 1034 from gensim._matutils import logsumexp, mean_absolute_difference, dirichlet_expectation
1035
1036 except ImportError:
/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
Per my comment at #3605 (comment), I don't see a problem if (a) installing gensim via !pip install --upgrade gensim; then (b) restarting the session as is often necessary when the underlying installed packages have changed.
As this seems to be roughly the same issues as #3605, let's do further discussion there unless the errors are shown to require different workarounds - so closing this as duplicate for now.
Description of Issue
A week ago everything was perfectly working, however, now, while importing gensim model Word2Vec, after successful installation of the gensim package in Google Colab, I am facing this error.
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
Steps to Reproduce Error
!pip install gensim
from gensim.models import Word2Vec
Complete Error Output
Output of Versions
Alternative Method (1)
!pip install --upgrade gensim
Output of Versions for this method
Alternative Method (2)
Output of Versions for this method
I have also tried reinstalling different versions of numpy, scipy and/or gensim, but no luck. Please look into this and resolve asap. Thanks!
The text was updated successfully, but these errors were encountered: