AttributeError: partially initialized module 'jieba' has no attribute 'cut' (most likely due to a circular import)
遇到这个问题时真是被自己傻哭了,就是文件名和库名一致了,将文件名换一个名字就可以了
Traceback (most recent call last): File "S:/Study/picture processing/mt/NaturalLanguageProcession/jieba.py", line 2, in <module> import jieba File "S:\Study\picture processing\mt\NaturalLanguageProcession\jieba.py", line 5, in <module> seg_list=jieba.cut("我喜欢吃酸菜鱼",cut_all=True) AttributeError: partially initialized module 'jieba' has no attribute 'cut' (most likely due to a circular import)
Traceback (most recent call last):
File “S:/Study/picture processing/mt/NaturalLanguageProcession/jieba.py”, line 2, in
import jieba
File “S:\Study\picture processing\mt\NaturalLanguageProcession\jieba.py”, line 5, in
seg_list=jieba.cut(“我喜欢吃酸菜鱼”,cut_all=True)
AttributeError: partially initialized module ‘jieba’ has no attribute ‘cut’ (most likely due to a circular import)
如果不是这个原因就是你的这个库没有安装
How to install jieba library?最后看见sucessfully就成功了,等安装的库完成加载了就可以了