Home > other >  Using stammer segmentation errors ImportError: No module named analyse
Using stammer segmentation errors ImportError: No module named analyse

Time:09-18

# - * - coding: utf-8 - * -
The import jieba
The import jieba. Analyse
Jieba. Load_userdict (" userdict1. TXT ")
Jieba. Analyse. Set_stop_words (" extra_dict/stop_words. TXT ")

Def splitSentence (inputFile outputFile) :
Fin=open (aa, 'r', encoding="utf-8")
Fout=open (bb, 'w', encoding="utf-8")
For the line in fin:
The line=line. Strip ()
The line=jieba. Analyse. Extract_tags (line)
Outstr="". Join (line)
Print (outstr)
Fout. Write (outstr + '\ n')
Fin. The close ()
Fout. Close ()
SplitSentence (' input. TXT ', 'output. TXT)

In this way, every time always tip ImportError: No module named analyse, strives for the big help!

CodePudding user response:

Jieba not installed well, are you sure you install version is right?

CodePudding user response:

reference 1st floor LICHAOZHONG_CSDN response:
jieba not installed well, are you sure the installed version is right?

CodePudding user response:

Look at the site - jieba folder has analyse the folder in the packages?

CodePudding user response:

The import sys
Sys. Path. Append ('/Users/WWH/Downloads/jieba - master/')

May also display warning, can run

CodePudding user response:

You may have multiple python version, you should put your jieba to install in python version you use now

CodePudding user response:

I was so solution: CMD - & gt; PIP search jieba - & gt; Find file location, and then put the folder named "jieba" copy directly to you to create the project folder xia - & gt; Ok

CodePudding user response:

https://blog.csdn.net/hbu_pig/article/details/79984585

CodePudding user response:

I also encountered this problem, the system may occur of the following reasons,
1, first of all, in the CMD command input "PIP install jieba", will be displayed after jieba installed, it is important to check jieba installation directory, open the directory, see there was a anylse this folder, if not, you need to install a correct jieba; Direct input in the CMD "PIP uninstall jieba", again in the website to download for your computer,
2, if jieba right analyse folder, so you need to use the 'import jieba. Analyse' command to load it, this is very important, and then can operate, (are generally not the problem, the above didn't try)

3, if not yet, it is to see if the python version on your computer,

CodePudding user response:

refer to the eighth floor JiJinCheng response:
I also encountered this problem, the system may occur of the following reasons,
1, first of all, in the CMD command input "PIP install jieba", will be displayed after jieba installed, it is important to check jieba installation directory, open the directory, see there was a anylse this folder, if not, you need to install a correct jieba; Direct input in the CMD "PIP uninstall jieba", again in the website to download for your computer,
2, if jieba right analyse folder, so you need to use the 'import jieba. Analyse' command to load it, this is very important, and then can operate, (are generally not the problem, the above didn't try)

3, if not yet, it is to see if the python version on your computer,

Hello I tried your method if still won't do

CodePudding user response:

refer to the eighth floor JiJinCheng response:
I also encountered this problem, the system may occur of the following reasons,
1, first of all, in the CMD command input "PIP install jieba", will be displayed after jieba installed, it is important to check jieba installation directory, open the directory, see there was a anylse this folder, if not, you need to install a correct jieba; Direct input in the CMD "PIP uninstall jieba", again in the website to download for your computer,
2, if jieba right analyse folder, so you need to use the 'import jieba. Analyse' command to load it, this is very important, and then can operate, (are generally not the problem, the above didn't try)

3, if not yet, it is to see if the python version on your computer,

Python is 3.7.6 anaconda is 3.7 64 - bit version is what I use be a spyder 4 sypder is higher?

  • Related