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

ติดตั้งโมดูล Python บน Cygwin

ตอนติดตั้ง Cygwin เลือก Package: python3, python3-setuptools (จะได้ easy_install)

ติดตั้ง pip ผ่าน easy_install

$ easy_install-3.8 pip   # แทน 3.8 ด้วย Version ที่ติดตั้ง

ใช้ pip ติดตั้งโมดูล

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

หมายเหตุ

  • Cygwin ให้ Python แบบ POSIX บน Windows
  • บาง Package ที่มี C Extension อาจ Build ไม่ผ่าน (ต้องมี Compiler Toolchain)
  • พิจารณาใช้ WSL2 หรือ Native Windows Python แทน