Skip to content
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 'regex._regex' #2870

Closed
7oda111 opened this issue Oct 27, 2021 · 5 comments
Closed

ModuleNotFoundError: No module named 'regex._regex' #2870

7oda111 opened this issue Oct 27, 2021 · 5 comments

Comments

@7oda111
Copy link

7oda111 commented Oct 27, 2021

i use this code in order to build a pipeline

import re
import nltk
from textblob import TextBlob
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from textblob import Word
from nltk.util import ngrams
import re
from wordcloud import WorldCloud , STOPWORDS
from nltk.tokenize import word_tokenize

the the error ModuleNotFoundError: No module named 'regex._regex' come up
any suggestions on the reason ???

@tomaarsen
Copy link
Member

tomaarsen commented Oct 27, 2021

@7oda111 I would recommend running

pip install -U regex

in a terminal. I suspect your version of regex is outdated.

@tomaarsen
Copy link
Member

I'm closing this. I suspect my comment above would work, and otherwise there are many other people who have encountered this before, e.g. psf/black#1207, which resolve it by pinning regex to a specific version.

@erikc96
Copy link

erikc96 commented Mar 30, 2022

Just had this issue popup. Does it make sense to pin the regex version to this project's requirements?

@tomaarsen
Copy link
Member

@erikc96 I'd say so. I'm willing to say that you won't have this issue again with regex>=2021.8.3. Good luck!

@Shivam-3108
Copy link

this issue popped up when I was importing nltk from a layer in aws lambda, the issue is with lambda detecting .cpython-xxxxx.so type of extensions and its compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants