Python manually installs the Jieba library (Win11)

Compared with English texts, the primary problem facing Chinese text mining is word segmentation, because there are no spaces between Chinese words. In Python, you can use the jieba library for Chinese word segmentation.

This article introduces the method of manually installing the jieba library to anaconda3 and python 3.11.

Download the jieba library

Download URL: jieba · PyPI 

After downloading, get the file: jieba-0.42.1.tar.gz

Extract to current folder:

E:\softwares\Python\jieba-0.42.1

Manually install to anaconda3

Copy the "jieba" directory to "D:\Programs\Anaconda3\Lib\site-packages":

Command execution verification:

python

import jieba

jieba.lcut("China is a great country")

The execution result is shown in the figure below:

Install manually to Python 3.11

Copy the "jieba" directory to "D:\Programs\Python\Python311\Lib\site-packages":

Command execution verification:

python

import jieba

jieba.lcut("China is a great country")

The execution result is shown in the figure below:

Note: The above is an example of anaconda and python on my personal computer. The installation directory of different computers may be different.

Related references:

  1. Installation of Jieba library. Installation of Jieba library_W_chuanqi's blog-CSDN blog_jieba library installation 
  2. The GitHub URL of the jieba library. GitHub - fxsjy/jieba: Jieba Chinese word segmentation 
  3. Jieba library official website download address. jieba PyPI 

Guess you like

Origin blog.csdn.net/Alexabc3000/article/details/127709831