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就成功了,等安装的库完成加载了就可以了



目录
相关文章
|
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'
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
246 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)
|
TensorFlow 算法框架/工具
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
243 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
UserWarning: The gensim.similarities.levenshtein submodule is disabled, because the optional Levensh
UserWarning: The gensim.similarities.levenshtein submodule is disabled, because the optional Levensh
125 0
UserWarning: The gensim.similarities.levenshtein submodule is disabled, because the optional Levensh
|
PyTorch 算法框架/工具
问题解决:AttributeError: 'module' object has no attribute '_rebuild_tensor_v2'
问题解决:AttributeError: 'module' object has no attribute '_rebuild_tensor_v2'
251 0
解决办法:ImportError: 'module' object has no attribute 'check_specifier'
解决办法:ImportError: 'module' object has no attribute 'check_specifier'
103 0
|
Python
AttributeError: module ‘time‘ has no attribute ‘clock‘的解决方法
在python3.10中flask项目运行报错: AttributeError: module 'time' has no attribute 'clock'解决方案 主要原因是因为python3.10中不支持clock了, 需要替换成 time.perf_counter() cpmpat.py文件:
347 0
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.
96 0
​Error -4075: File not found. An error occurred merging module <MODULENAME> for feature <FEATURENAME>.