最近在研究 nltk 运行时出现如下错误:
AttributeError: module 'nltk' has no attribute 'word_tokenize'
语法不存在任何问题,为什么会这样呢?原因是我的python文件命名与包的名字相同,都是nltk
AttributeError: module 'nltk' has no attribute 'word_tokenize'
解决办法:
我创建了code1文件,运行时依然会出现同样的错误,试着删掉nltk.py文件,程序顺利运行。(你也可以试着改个名字)

参考网址:
https://www.cnblogs.com/LHWorldBlog/p/9641374.html

相关文章:

  • 2021-10-09
  • 2021-12-13
  • 2021-06-06
  • 2021-07-27
  • 2021-05-07
  • 2022-01-23
  • 2021-08-17
  • 2021-07-26
猜你喜欢
  • 2021-11-14
  • 2021-09-15
  • 2021-11-02
  • 2021-11-28
  • 2021-08-27
  • 2021-10-09
  • 2021-09-09
相关资源
相似解决方案