-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFoundError: No module named 'numpy.char' when importing Word2Vec #3605
Comments
Yes, I am also facing issues while importing Word2Vec in Colab, although few days back, it was working fine. Now it is creating issues after installing gensim using |
If in a Colab notebook I install the latest Gensim using…
…it successfully installs & rolls-back Thus if you immediately try running any code involving packages that have changed out from under the session – like the downgraded For example, if I immediately try However, if I use the Colab I could have sworn Colab used to warn & prompt when changing packages required a session restart. I didn't see any such warning just now. But it's still often necessary when changing packages out from under a running Python instance. |
@gojomo I tried the upgrade command too, but couldn't find the restart option, earlier, however, after your guidance, I have been able to run the code smoothly. I assume this is the option which you referred to? (Pasting it for visual assistance of others) Previously, it was automatically fetching the updated packages, so now there is 1 step additional, i.e. manual restarting of runtime. Alternative SolutionIf anyone doesn't want to manually restart the runtime, they can run this code block after
Concluding this, I have tested both methods, and they work, so, thanks @gojomo once again for the assistance! |
!pip install --upgrade gensim It's work of me! |
great thanks, it works for me |
Yes, that's the 'restart session' menu pick I was referring-to. The |
Description
When trying to import Word2Vec from gensim in Google Colab, I consistently encounter a "ModuleNotFoundError: No module named 'numpy.char'" error, despite successful installation of gensim and its dependencies.
Environment
Steps to reproduce
!pip install gensim
from gensim.models import Word2Vec
Error message
ModuleNotFoundError Traceback (most recent call last)
in <cell line: 0>()
1 #!pip install --no-cache-dir --force-reinstall gensim
2 # !pip install gensim
----> 3 from gensim.models import Word2Vec
4 import os
5 from tqdm import tqdm
9 frames
/usr/local/lib/python3.11/dist-packages/numpy/init.py in getattr(attr)
365 raise AssertionError()
366 except AssertionError:
--> 367 msg = ("The current Numpy installation ({!r}) fails to "
368 "pass simple sanity checks. This can be caused for example "
369 "by incorrect BLAS library being linked in, or by mixing "
ModuleNotFoundError: No module named 'numpy.char'
What I've tried
--no-cache-dir
and--force-reinstall
flagsThe text was updated successfully, but these errors were encountered: