AttributeError: partially initialized module ‘jieba‘ has no attribute ‘cut‘ (most likely due to a ci

本文涉及的产品
图片翻译,图片翻译 100张
语种识别,语种识别 100万字符
文本翻译,文本翻译 100万字符
简介: AttributeError: partially initialized module ‘jieba‘ has no attribute ‘cut‘ (most likely due to a ci
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)image.png


如果不是这个原因就是你的这个库没有安装

How to install jieba library?image.pngimage.png最后看见sucessfully就成功了,等安装的库完成加载了就可以了



目录
相关文章
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
412 0
|
6月前
|
开发者 Python
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
912 0
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
|
6月前
|
Python
【Python】已解决:AttributeError: module ‘sys’ has no attribute ‘setdefaultencoding’
【Python】已解决:AttributeError: module ‘sys’ has no attribute ‘setdefaultencoding’
313 0
|
8月前
|
JSON 数据格式
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
|
6月前
|
机器学习/深度学习 Python
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
306 0
|
6月前
|
Python
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
408 0
|
6月前
|
Web App开发 测试技术 API
【Python】已解决:TypeError: *init*() got an unexpected keyword argument ‘firefox_options’
【Python】已解决:TypeError: *init*() got an unexpected keyword argument ‘firefox_options’
114 0
|
6月前
|
Python
【Python】已解决:TypeError: write._Log() takes 0 positional arguments but 1 was given
【Python】已解决:TypeError: write._Log() takes 0 positional arguments but 1 was given
225 0
|
8月前
|
开发工具
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
235 0
Multiple substitutions specified in non-positional format; did you mean to add BUG(7)
Multiple substitutions specified in non-positional format; did you mean to add BUG(7)