Seeking for help on : " How to import jieba.analyse "

Dear all :

i have one question on " How to import jieba.analyse " . since i have already import jieba library and it seems the " jieba library " has been successfully installed ! but when i want to import " jieba.analyse "
the result turned out to be wrong as below :

Traceback (most recent call last):
File “”, line 22, in
import jeiba.analyse
ModuleNotFoundError: No module named ‘jeiba’

So my question is how to solve this problem ? and what next step should i take when i have already imported " jieba library" through hitting " Package Button " ? the 3rd question is that when you want to import 3rd party library , is it the right way to hit the " Package Button ? my Python code is as below and please kindly advise and tell me now to finish " importing jieba.analyse " ! Thank you very much !



重點一: 所有你的project都應該放在project下面(所有資源都要放在專案底下)

要用檔案路徑的時候: 用一個相對路徑去寫

用 的時候, a.txt(文字檔要直接上傳到雲端)

f = open(“a.txt”, “r”, encoding=“utf-8”) # 第一個步驟
article = # 第二個步驟, 這個文字給它一個名字叫article
f.close() # 第三個步驟


result = {} # {} 是字典(袋子)的符號, 所以result是空的字典
for c in article:


if c in result:
result[c] = result[c] + 1 # 這樣設定回去且這句話是屬於if的, 所以要"縮排", 裡面次數拿出來之後,加1再設定回去


result[c] = 1
print(result) # "皮"出現4次, ","出現22次, 每一個字都幫你統計完了


import jeiba.analyse

keywords = jeiba.analyse.extract_tags(article, 5)
print(“這篇文章最關鍵的詞是:”, keywords)

1 Like

Hi @anakinsLin thank you for your question.

I wonder if you have accidentally misspelled jieba when trying to import?

1 Like

Hi Ian:

Got it and really appreciate your help! Thanks again!



No problem at all @anakinsLin - have a great day!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.