Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

ติดตั้งโมดูล unidecode บน Linux (คู่มือ pip ทั่วไป)

ขั้นตอนติดตั้ง unidecode (หรือโมดูลไหนก็ตาม) บน Linux ด้วย pip

1. ตรวจสอบ/อัปเกรด pip

# Linux/macOS
pip install -U pip setuptools

# Windows
python -m pip install -U pip setuptools

2. ติดตั้ง unidecode

$ pip install 'unidecode'           # ล่าสุด
$ pip install 'unidecode==0.04'     # เวอร์ชันเฉพาะ
$ pip install 'unidecode>=0,<1'     # ช่วงเวอร์ชัน

หากใช้ Python ของ System Package Manager (apt/yum)

ดูคำแนะนำ: Installing using Linux tools

หาก pip ไม่ทำงาน

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
unidecode ใช้แปลง Unicode Text ให้เป็น ASCII ใกล้เคียง (Transliteration) เช่น "café" → "cafe"