AttributeError:模块“regex”没有属性“Pattern”

mis*_*bot 4 python python-3.x data-science google-colaboratory

我在尝试在 google colab 中运行此代码时收到此错误:

!pip install dataprep
from dataprep.eda import create_report
Run Code Online (Sandbox Code Playgroud)

错误:

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'
Run Code Online (Sandbox Code Playgroud)

事情很奇怪,因为这段代码昨天运行得很好。有任何想法吗?

错误

ogd*_*kev 5

这看起来像是NLTK 中的一个已知问题。也许更新NLTK版本。