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

本文涉及的产品
文档翻译,文档翻译 1千页
文本翻译,文本翻译 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就成功了,等安装的库完成加载了就可以了



目录
相关文章
|
TensorFlow 算法框架/工具 Python
成功解决AttributeError: module 'numpy' has no attribute 'equal'
成功解决AttributeError: module 'numpy' has no attribute 'equal'
成功解决AttributeError: module 'numpy' has no attribute 'equal'
|
3月前
|
PyTorch 算法框架/工具 Python
Traceback (most recent call last):WARNING: Dataset not found, nonexistent paths:
这篇文章描述了在使用YOLOv5进行训练时遇到的"Dataset not found"错误,分析了可能的原因,包括网络连接问题和数据集路径配置错误,并提供了相应的解决方法,如检查网络设置和确认数据集文件的存放位置。
Traceback (most recent call last):WARNING: Dataset not found, nonexistent paths:
|
4月前
|
开发者 Python
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
618 0
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
|
4月前
|
Python
【Python】已解决:AttributeError: module ‘sys’ has no attribute ‘setdefaultencoding’
【Python】已解决:AttributeError: module ‘sys’ has no attribute ‘setdefaultencoding’
216 0
|
6月前
|
JSON 数据格式
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
|
4月前
|
机器学习/深度学习 Python
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
141 0
|
4月前
|
Python
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
298 0
|
11月前
|
Kubernetes Python 微服务
Python3异常-AttributeError: module 'sys' has no attribute 'setdefaultencoding
Python3异常-AttributeError: module 'sys' has no attribute 'setdefaultencoding
91 0
|
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
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)