【问题标题】:AttributeError: module 'regex' has no attribute 'Pattern'AttributeError:模块“正则表达式”没有属性“模式”
【发布时间】:2021-11-23 02:32:28
【问题描述】:

尝试在 google colab 中运行此代码时出现此错误:

!pip install dataprep
from dataprep.eda import create_report

错误:

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'

事情很奇怪,因为这段代码昨天运行良好。 有什么想法吗?

Error

【问题讨论】:

    标签: python python-3.x data-science google-colaboratory


    【解决方案1】:

    这看起来像known issue in NLTK。也许更新 NLTK 版本。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-14
    • 1970-01-01
    • 2019-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-19
    相关资源
    最近更新 更多