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

本文涉及的产品
文本翻译,文本翻译 100万字符
图片翻译,图片翻译 100张
文档翻译,文档翻译 1千页
简介: 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就成功了,等安装的库完成加载了就可以了



目录
相关文章
|
IDE PyTorch 网络安全
|
TensorFlow 算法框架/工具 Python
成功解决AttributeError: module 'numpy' has no attribute 'equal'
成功解决AttributeError: module 'numpy' has no attribute 'equal'
成功解决AttributeError: module 'numpy' has no attribute 'equal'
|
5月前
|
开发者 Python
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
838 0
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
|
7月前
|
JSON 数据格式
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
|
5月前
|
Python
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
374 0
|
5月前
|
机器学习/深度学习 Python
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
251 0
|
7月前
|
开发工具
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
229 0
|
7月前
|
测试技术
ERROR [karma]_ TypeError_ Cannot read property 'unmask' of undefine
ERROR [karma]_ TypeError_ Cannot read property 'unmask' of undefine
61 0
成功解决Failed to execute stage ‘Setup validation’: Cannot locate gluster packages
成功解决Failed to execute stage ‘Setup validation’: Cannot locate gluster packages
|
TensorFlow 算法框架/工具 Python
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo