Home > OS >  AttributeError: module 'regex' has no attribute 'Pattern'
AttributeError: module 'regex' has no attribute 'Pattern'

Time:10-02

I'm getting this error while trying to run this code in google colab:

!pip install dataprep
from dataprep.eda import create_report

Error:

NumExpr defaulting to 2 threads.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-db62224f8a79> in <module>()
----> 1 from dataprep.eda import create_report

10 frames
/usr/local/lib/python3.7/dist-packages/nltk/tokenize/casual.py in TweetTokenizer()
    355 
    356     @property
--> 357     def WORD_RE(self) -> regex.Pattern:
    358         """Core TweetTokenizer regex"""
    359         # Compiles the regex for this and all future instantiations of TweetTokenizer.

AttributeError: module 'regex' has no attribute 'Pattern'

Thing is pretty strange, as this code worked fine yesterday. Any ideas?

Error

CodePudding user response:

This looks like a known issue in NLTK. Perhaps update the NLTK version.

  • Related