fxsjy / jieba

结巴中文分词
MIT License
32.86k stars 6.71k forks source link

无法调用Jieba库--module 'jieba' has no attribute 'Icut' #715

Open xiaoyumaokk opened 5 years ago

xiaoyumaokk commented 5 years ago

import jieba jieba.Icut("全国计算机等级考试")

AttributeError Traceback (most recent call last)

in () 1 import jieba ----> 2 jieba.Icut("全国计算机等级考试") AttributeError: module 'jieba' has no attribute 'Icut' 不知道是为何错了,求大神解答
leolim031 commented 5 years ago

可能你保存的文件名字是jieba.py

AwesomeTang commented 5 years ago

貌似没有Icut吧 你是不是指的jieba.lcut, 以list形式返回切完的词语

import jieba

print(jieba.lcut("全国计算机等级考试"))

# out: ['全国', '计算机', '等级', '考试']
ahbon123 commented 4 years ago

还是报AttributeError: module 'jieba' has no attribute 'lcut'这个错,请问咋解决呀?