I am simply doing the following import statements:
from gensim.test.utils import common_texts
from gensim.models import Word2Vec
but I keep getting the following error
Traceback (most recent call last):
File "/Users/user/PycharmProjects/COMP34711-NLP-CW2/main.py", line 15, in <module>
from gensim.test.utils import common_texts
File "/Users/user/.conda/envs/COMP34711-NLP-CW2/lib/python3.8/site-packages/gensim/__init__.py", line 11, in <module>
from gensim import parsing, corpora, matutils, interfaces, models, similarities, utils # noqa:F401
File "/Users/user/.conda/envs/COMP34711-NLP-CW2/lib/python3.8/site-packages/gensim/corpora/__init__.py", line 6, in <module>
from .indexedcorpus import IndexedCorpus # noqa:F401 must appear before the other classes
File "/Users/user/.conda/envs/COMP34711-NLP-CW2/lib/python3.8/site-packages/gensim/corpora/indexedcorpus.py", line 14, in <module>
from gensim import interfaces, utils
File "/Users/user/.conda/envs/COMP34711-NLP-CW2/lib/python3.8/site-packages/gensim/interfaces.py", line 19, in <module>
from gensim import utils, matutils
File "/Users/user/.conda/envs/COMP34711-NLP-CW2/lib/python3.8/site-packages/gensim/matutils.py", line 1024, in <module>
from gensim._matutils import logsumexp, mean_absolute_difference, dirichlet_expectation
File "gensim/_matutils.pyx", line 1, in init gensim._matutils
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
I have tried updating my Numpy package (as per this answer) to 1.21.4 (the latest at the time of this post), but I still keep getting the same issue.
Update: It seems like there is a bit of incompatibility between Gensim and Apple's M1 processors as per these github issues opened in the official Gensim repository. This issue specifically, shows my exact issue with it.